From 11e2d7cb7f69b956644adc9a5639a3d4aeb18411 Mon Sep 17 00:00:00 2001 From: Rupert Moran-Adcock Date: Sat, 25 Apr 2020 17:33:19 +1200 Subject: [PATCH] Revert "Fixed bug: can't add task on a selected date #232" This reverts commit 75bf48f5e0256aa2b1755d331d5037d787539cce. --- doto-frontend/src/components/pages/Calendar/TaskScheduler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doto-frontend/src/components/pages/Calendar/TaskScheduler.js b/doto-frontend/src/components/pages/Calendar/TaskScheduler.js index dd74cfc1..0647102c 100644 --- a/doto-frontend/src/components/pages/Calendar/TaskScheduler.js +++ b/doto-frontend/src/components/pages/Calendar/TaskScheduler.js @@ -67,7 +67,7 @@ const addTaskToSchedule = (newTask, existingTasks, currDate) => { } } - newTask.startDate = cTask ? newTask.dueDate : minDate; + newTask.startDate = cTask ? cTask.endDate : minDate; newTask.startDate = new Date(newTask.startDate.getTime()); @@ -76,7 +76,7 @@ const addTaskToSchedule = (newTask, existingTasks, currDate) => { } newTask.endDate = - (cTask && new Date(newTask.dueDate.getTime() + newTask.duration * MILLISECONDS_PER_MINUTE)) || + (cTask && new Date(cTask.endDate.getTime() + newTask.duration * MILLISECONDS_PER_MINUTE)) || new Date(minDate.getTime() + newTask.duration * MILLISECONDS_PER_MINUTE); return {