Skip to content

Commit 6a5e23c

Browse files
committed
used Date.UTC in order to fix test for all timezone
1 parent 1e806dd commit 6a5e23c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

test/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@
12131213
it("should correctly parse example 3", function () {
12141214
var res = js2xmlparser("person", {
12151215
"email": function() {return "john@smith.com";},
1216-
"dateOfBirth": new Date(1964, 7, 26)
1216+
"dateOfBirth": new Date(Date.UTC(1964, 7, 26))
12171217
}, {
12181218
declaration: {
12191219
include: false
@@ -1231,7 +1231,7 @@
12311231
}
12321232
});
12331233
res.should.equal("<person><email>function () {return &quot;john@smith.com&quot;;}</email>" +
1234-
"<dateOfBirth>1964-08-26T04:00:00.000Z</dateOfBirth></person>");
1234+
"<dateOfBirth>1964-08-26T00:00:00.000Z</dateOfBirth></person>");
12351235
});
12361236

12371237
it("should correctly parse example 4", function () {

0 commit comments

Comments
 (0)