Skip to content

Commit 3636483

Browse files
author
Dustin Farris
committed
Merge pull request #102 from dustinfarris/fix-date-test
Avoid adjusting dates due to local timezone
2 parents fb2872b + e412c35 commit 3636483

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/transforms/date.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ DS.DjangoDateTransform = DS.Transform.extend({
1212
},
1313
serialize: function(date) {
1414
if (date instanceof Date && date.toString() !== 'Invalid Date') {
15-
return date.toISOString().slice(0, 10);
15+
year = date.getFullYear();
16+
month = date.getMonth() + 1; // getMonth is 0-indexed
17+
month = month < 10 ? '0' + month : month;
18+
day = date.getDate();
19+
return year + '-' + month + '-' + day;
1620
} else {
1721
return null;
1822
}

0 commit comments

Comments
 (0)