0
ectabyte created
Hi! I have a dto with a moment (date and time) property, when JSON.stringify is called it changes the moment value. I want to send this date-time value to the server without any chages or conversations (and also get it back). Please help on this topic! Thanks!
1 Answer(s)
-
0
for anybody has this issue.. you have to set the parameter keepOffset to true in the toISOString() function like this:
toJSON(data?: any) { ... data["yourProperty"] = this.date ? this.date.toISOString(true) : <any>undefined; ... }