json dates have milliseconds
This commit is contained in:
parent
5c2842e0d4
commit
f37c60b31a
1 changed files with 6 additions and 1 deletions
|
@ -142,6 +142,8 @@ Ox.fallback.JSON <o> see https://github.com/douglascrockford/JSON-js
|
||||||
{a: [1, 2], b: [3, 4]}
|
{a: [1, 2], b: [3, 4]}
|
||||||
> Ox.fallback.JSON.stringify([(function(){ return arguments; }()), false, null, 0, Infinity, NaN, / /, void 0])
|
> Ox.fallback.JSON.stringify([(function(){ return arguments; }()), false, null, 0, Infinity, NaN, / /, void 0])
|
||||||
'[{},false,null,0,null,null,{},null]'
|
'[{},false,null,0,null,null,{},null]'
|
||||||
|
> Ox.fallback.JSON.stringify(new Date()).length
|
||||||
|
24
|
||||||
@*/
|
@*/
|
||||||
Ox.fallback.JSON = (function() {
|
Ox.fallback.JSON = (function() {
|
||||||
var replace = {
|
var replace = {
|
||||||
|
@ -179,7 +181,10 @@ Ox.fallback.JSON = (function() {
|
||||||
} else if (type == 'boolean') {
|
} else if (type == 'boolean') {
|
||||||
ret = String(value);
|
ret = String(value);
|
||||||
} else if (type == 'date') {
|
} 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') {
|
} else if (type == 'number') {
|
||||||
ret = isFinite(value) ? String(value) : 'null';
|
ret = isFinite(value) ? String(value) : 'null';
|
||||||
} else if (type == 'object') {
|
} else if (type == 'object') {
|
||||||
|
|
Loading…
Reference in a new issue