From c670eeef55c785970cdb760df362149d573d80a7 Mon Sep 17 00:00:00 2001 From: Sakura Knoll Date: Tue, 28 Dec 2021 22:00:29 +0900 Subject: [PATCH] Start a week from monday instead of sunday --- src/components/organisms/GanttChart.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/organisms/GanttChart.tsx b/src/components/organisms/GanttChart.tsx index 75b8e5a7..1e7319b5 100644 --- a/src/components/organisms/GanttChart.tsx +++ b/src/components/organisms/GanttChart.tsx @@ -33,8 +33,8 @@ const GanttChart = ({ }: GanttChartProps) => { const startDate = new Date(startDateString) const endDate = new Date(endDateString) - const firstDateToRender = subDays(startDate, startDate.getDay()) - const lastDateToRender = addDays(endDate, 6 - endDate.getDay()) + const firstDateToRender = subDays(startDate, startDate.getDay() - 1) + const lastDateToRender = addDays(endDate, 6 - endDate.getDay() + 1) const todayDate = new Date(todayDateString) const daysToRender = differenceInCalendarDays(