diff --git a/frontend/src/components/gantt/GanttChart.vue b/frontend/src/components/gantt/GanttChart.vue index f60c255ac..efc30de73 100644 --- a/frontend/src/components/gantt/GanttChart.vue +++ b/frontend/src/components/gantt/GanttChart.vue @@ -40,7 +40,7 @@ >
([]) const ganttRows = ref([]) const cellsByRow = ref>({}) -function getRoundedDate(value: string | Date | undefined, fallback: Date, isStart: boolean) { +function getRoundedDate(value: string | Date | undefined, fallback: Date | string, isStart: boolean) { return roundToNaturalDayBoundary(value ? new Date(value) : new Date(fallback), isStart) } function transformTaskToGanttBar(t: ITask): GanttBarModel { - const startDate = getRoundedDate(t.startDate, props.defaultTaskStartDate, true) - const endDate = getRoundedDate(t.endDate, props.defaultTaskEndDate, false) + const startDate = getRoundedDate(t.startDate ?? undefined, props.defaultTaskStartDate, true) + const endDate = getRoundedDate(t.endDate ?? undefined, props.defaultTaskEndDate, false) const taskColor = getHexColor(t.hexColor) @@ -188,8 +188,8 @@ watch( return false } - const taskStart = getRoundedDate(task.startDate, props.defaultTaskStartDate, true) - const taskEnd = getRoundedDate(task.endDate, props.defaultTaskEndDate, false) + const taskStart = getRoundedDate(task.startDate ?? undefined, props.defaultTaskStartDate, true) + const taskEnd = getRoundedDate(task.endDate ?? undefined, props.defaultTaskEndDate, false) // Task is visible if it overlaps with the current date range return taskStart <= dateToDate.value