Start a week from monday instead of sunday

This commit is contained in:
Sakura Knoll
2021-12-28 22:00:29 +09:00 Unverified
parent 994a02cb53
commit c670eeef55
+2 -2
View File
@@ -33,8 +33,8 @@ const GanttChart = ({
}: GanttChartProps) => { }: GanttChartProps) => {
const startDate = new Date(startDateString) const startDate = new Date(startDateString)
const endDate = new Date(endDateString) const endDate = new Date(endDateString)
const firstDateToRender = subDays(startDate, startDate.getDay()) const firstDateToRender = subDays(startDate, startDate.getDay() - 1)
const lastDateToRender = addDays(endDate, 6 - endDate.getDay()) const lastDateToRender = addDays(endDate, 6 - endDate.getDay() + 1)
const todayDate = new Date(todayDateString) const todayDate = new Date(todayDateString)
const daysToRender = differenceInCalendarDays( const daysToRender = differenceInCalendarDays(