json dates have milliseconds

This commit is contained in:
rolux 2012-05-26 15:05:35 +02:00
parent 5c2842e0d4
commit f37c60b31a

View file

@ -142,6 +142,8 @@ Ox.fallback.JSON <o> see https://github.com/douglascrockford/JSON-js
{a: [1, 2], b: [3, 4]}
> Ox.fallback.JSON.stringify([(function(){ return arguments; }()), false, null, 0, Infinity, NaN, / /, void 0])
'[{},false,null,0,null,null,{},null]'
> Ox.fallback.JSON.stringify(new Date()).length
24
@*/
Ox.fallback.JSON = (function() {
var replace = {
@ -179,7 +181,10 @@ Ox.fallback.JSON = (function() {
} else if (type == 'boolean') {
ret = String(value);
} else if (type == 'date') {
ret = Ox.getISODate(value, true);
ret = Ox.splice(
Ox.getISODate(value, true), 19, 0,
'.' + String(+value).slice(-3)
);
} else if (type == 'number') {
ret = isFinite(value) ? String(value) : 'null';
} else if (type == 'object') {