mobxjs / serializr

Serialize and deserialize complex object graphs to and from JSON and Javascript classes
MIT License
766 stars 52 forks source link

Date fix for Safari #69

Closed alex-karlin closed 6 years ago

alex-karlin commented 7 years ago

There's a known behavior in Safari that applies current OS time zone to the date object when the Date constructor (or Date.parse method) is used. Because of this serializr will produce the date of 2017/12/07 in New Zealand time zone for the value of '2017-12-06T15:37:39.903'. The suggested fix will mitigate the issue for ISO 8601 format date strings without timezones.

See the following links for more details: https://stackoverflow.com/a/33909265 https://stackoverflow.com/a/6427318

@mweststrate

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.3%) to 91.772% when pulling e5492c9ff947d73695ebd8a21a0304c18281d26b on kiwio:patch-1 into 59fe6e569ec72c102bc8ed3a2ec3697edea35bf0 on mobxjs:master.

alex-karlin commented 6 years ago

Will open a new pull request with proper implementation plus more unit tests.