BUG: Better date parsing and handling in transform (#82)
This commit is contained in:
parent
ab30692021
commit
d2c485af88
1 changed files with 4 additions and 3 deletions
|
@ -7,9 +7,10 @@ export default DS.Transform.extend({
|
||||||
|
|
||||||
serialize(date) {
|
serialize(date) {
|
||||||
if (date !== '') {
|
if (date !== '') {
|
||||||
const day = date.getDate();
|
date = new Date(date);
|
||||||
const month = date.getMonth() + 1;
|
const day = date.getUTCDate();
|
||||||
const year = date.getFullYear();
|
const month = date.getUTCMonth() + 1;
|
||||||
|
const year = date.getUTCFullYear();
|
||||||
return `${year}-${month}-${day}`;
|
return `${year}-${month}-${day}`;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue