From f37c60b31af3556970d34ffc169430507364d00b Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 26 May 2012 15:05:35 +0200 Subject: [PATCH] json dates have milliseconds --- source/Ox/js/Fallback.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/Ox/js/Fallback.js b/source/Ox/js/Fallback.js index 914a6625..7abb325a 100644 --- a/source/Ox/js/Fallback.js +++ b/source/Ox/js/Fallback.js @@ -142,6 +142,8 @@ Ox.fallback.JSON 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') {