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) {
|
||||
if (date !== '') {
|
||||
const day = date.getDate();
|
||||
const month = date.getMonth() + 1;
|
||||
const year = date.getFullYear();
|
||||
date = new Date(date);
|
||||
const day = date.getUTCDate();
|
||||
const month = date.getUTCMonth() + 1;
|
||||
const year = date.getUTCFullYear();
|
||||
return `${year}-${month}-${day}`;
|
||||
} else {
|
||||
return null;
|
||||
|
|
Loading…
Add table
Reference in a new issue