Skip to content

Commit e3daa59

Browse files
committed
Fix failing unit tests
* Tests: FAIL (3) ** Conversion Error: Wanted: "2008-10-25T05:00:00.000Z" -- Got: "2008-10-24T22:00:00.000Z" ** Manual Conversion Error: Wanted: "2008-10-25T05:00:00.000Z" -- Got: "2008-10-24T22:00:00.000Z" ** Conversion Error: Wanted: "2008-10-25T05:00:00.000Z" -- Got: "2008-10-24T22:00:00.000Z" * Reason being the UTC conversions, since I'm in Europe it failed. Using UTC timestamp as input instead.
1 parent 7a70268 commit e3daa59

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

jquery.json.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ testJSON([0, false, function() {}], '[0,false,null]');
5858
testJSON(0, '0');
5959
testJSON(false, 'false');
6060
testJSON(null, 'null');
61-
testJSON(new Date(2008, 9, 25), '"2008-10-25T05:00:00.000Z"');
61+
// '1224892800000' is the Epoch timestamp of midnight October 25, 2008.
62+
testJSON(new Date(1224892800000), '"2008-10-25T00:00:00.000Z"');
6263

6364
// Temporarily remove Date's toJSON and JSON.stringify
6465
dateToJSON = Date.prototype.toJSON;
@@ -68,7 +69,7 @@ if (typeof JSON === 'object' && JSON.stringify) {
6869
JSON.stringify = null;
6970
}
7071

71-
testJSON(new Date(2008, 9, 25), '"2008-10-25T05:00:00.000Z"');
72+
testJSON(new Date(1224892800000), '"2008-10-25T00:00:00.000Z"');
7273

7374
// Restore Date's toJSON and JSON.stringify
7475
Date.prototype.toJSON = dateToJSON;

0 commit comments

Comments
 (0)