From a706089f7bb7f0c5c0757dd0662b879cee22afc8 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 8 Mar 2020 20:07:21 +0100 Subject: [PATCH] Fix changing task dates (due/start/end/reminders) Fixes #71 --- src/services/task.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/services/task.js b/src/services/task.js index 6e69c7d0..5ea70406 100644 --- a/src/services/task.js +++ b/src/services/task.js @@ -31,9 +31,9 @@ export default class TaskService extends AbstractService { model.listID = Number(model.listID) // Convert dates into an iso string - model.dueDate = model.dueDate === null ? null : formatISO(model.dueDate) - model.startDate = model.startDate === null ? null : formatISO(model.startDate) - model.endDate = model.endDate === null ? null : formatISO(model.endDate) + model.dueDate = model.dueDate === null ? null : formatISO(new Date(model.dueDate)) + model.startDate = model.startDate === null ? null : formatISO(new Date(model.startDate)) + model.endDate = model.endDate === null ? null : formatISO(new Date(model.endDate)) model.created = formatISO(model.created) model.updated = formatISO(model.updated) @@ -47,7 +47,7 @@ export default class TaskService extends AbstractService { // Make normal timestamps from js dates if(model.reminderDates.length > 0) { model.reminderDates = model.reminderDates.map(r => { - return formatISO(r) + return formatISO(new Date(r)) }) }