From cb98ff2b6e4c012a642a130df2fc3275455506a3 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Mon, 17 Jul 2023 17:12:28 +0700 Subject: [PATCH] Fix duration --- edit-mode/function/ganttEvent.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/edit-mode/function/ganttEvent.js b/edit-mode/function/ganttEvent.js index efad77a..48d9e9d 100644 --- a/edit-mode/function/ganttEvent.js +++ b/edit-mode/function/ganttEvent.js @@ -56,14 +56,14 @@ gantt.attachEvent("onBeforeTaskUpdate", function(id,new_item){ let link = task.$target; // link.length > 0 -> successor new_item['progress'] = progress; - new_item['duration'] = new_item['duration'] + (link.length == 0 ? 1 : 1); + new_item['duration'] = new_item['duration'] + (link.length == 0 ? 0 : 1); new_item['end_date'] = gantt.calculateEndDate({ start_date: new_item['start_date'], duration: new_item['duration'] }) new_item['end_date'].setHours(23,59,59); if (editDurationTriggered) { - let tempDuration = new_item['duration'] - (link.length == 0 ? 1 : 1); + let tempDuration = new_item['duration'] - 1; new_item['end_date'] = gantt.calculateEndDate({ start_date: new_item['start_date'], duration: tempDuration