diff --git a/edit-mode/function/ganttConfig.js b/edit-mode/function/ganttConfig.js index 06f8430..7b988d6 100644 --- a/edit-mode/function/ganttConfig.js +++ b/edit-mode/function/ganttConfig.js @@ -304,8 +304,8 @@ var allColumns = [ { name: "baseline_progress", label: "Baseline Progress (%)", align: "center", editor: baselineProgressEditor, min_width: 125, template: function (text) { let today = new Date(); - let start = new Date(text.planned_start) || new Date(text.start_date); - let end = new Date(text.planned_end) || new Date(text.end_date); + let start = text.planned_start ? new Date(text.planned_start) : new Date(text.start_date); + let end = text.planned_end ? new Date(text.planned_end) : new Date(text.end_date); let todayDuration = gantt.calculateDuration({ start_date: start, end_date: today @@ -318,6 +318,9 @@ var allColumns = [ todayDuration = 0; } progress = todayDuration/endDuration * 100 + if (progress > 100) { + progress = 100; + } return roundToTwo(progress); }, resize: true },