-
I have a project where i am using your library. I ran into problems when serializing and deserialising dates. Is it possible to have something that parses the date, in the js format, when calling reading from the localstorage. dateTimeReviver = function (key, value) {
var a;
if (typeof value === 'string') {
a = /\/Date\((\d*)\)\//.exec(value);
if (a) {
return new Date(+a[1]);
}
}
return value;
}
JSON.parse(somejsonstring, dateTimeReviver); Or is there someway i am missing to get the date parsed |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @JolloDede JSON does not support dates. |
Beta Was this translation helpful? Give feedback.
Hi @JolloDede
JSON does not support dates.
But you can use
devalue
instead. Just specify an option forserializer
, for example:serializer: devalue
.