JSON-Patch icon indicating copy to clipboard operation
JSON-Patch copied to clipboard

JSON.stringify converts dates to UTC which may not always be desirable

Open cbierFL opened this issue 7 years ago • 1 comments

When deep cloning the object to create an operation it looks like all objects are being JSON stringified. JSON.stringify converts all dates to UTC.

This is a problem if the server is giving the UI a non-utc date, and then the UI is patching that date back with a different time zone.

https://github.com/Starcounter-Jack/JSON-Patch/blob/0d6be6a09284fa694a493f39604469d082dad6d5/dist/fast-json-patch.js#L120

cbierFL avatar Jan 24 '19 15:01 cbierFL

Missed the related issues / PRs: https://github.com/Starcounter-Jack/JSON-Patch/pull/2 https://github.com/Starcounter-Jack/JSON-Patch/issues/4

This one is slightly different in that it's not a big deal that its becoming a string. Just that the timezone is being changed

cbierFL avatar Jan 24 '19 15:01 cbierFL