From d2c485af885cd52c786b0d8e486bed734708a99b Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sat, 24 Mar 2018 15:59:51 +0200 Subject: [PATCH] BUG: Better date parsing and handling in transform (#82) --- app/transforms/ccdb-date.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/transforms/ccdb-date.js b/app/transforms/ccdb-date.js index bea5d72..7068e48 100644 --- a/app/transforms/ccdb-date.js +++ b/app/transforms/ccdb-date.js @@ -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;