From 78abd2e88f26f84b3391893af55d927d301219d7 Mon Sep 17 00:00:00 2001 From: konrad Date: Sun, 3 Mar 2019 20:56:00 +0000 Subject: [PATCH] fix for task dates update (#22) --- 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 afbd71b8..e63cadb5 100644 --- a/src/services/task.js +++ b/src/services/task.js @@ -17,9 +17,9 @@ export default class TaskService extends AbstractService { beforeUpdate(model) { // Convert the date in a unix timestamp - model.dueDate = (+ new Date(model.dueDate)) / 1000 - model.startDate = (+ new Date(model.startDate)) / 1000 - model.endDate = (+ new Date(model.endDate)) / 1000 + model.dueDate = +new Date(model.dueDate) / 1000 + model.startDate = +new Date(model.startDate) / 1000 + model.endDate = +new Date(model.endDate) / 1000 // remove all nulls, these would create empty reminders for (const index in model.reminderDates) { @@ -30,7 +30,7 @@ export default class TaskService extends AbstractService { // Make normal timestamps from js dates model.reminderDates = model.reminderDates.map(r => { - return Math.round(r / 1000) + return Math.round(+new Date(r) / 1000) }) // Make the repeating amount to seconds