From 5ba055400b0cb7cec1abf88251789209bb500116 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 23 Jul 2021 17:01:49 +0300 Subject: [PATCH] Calendar: Fix months starting from Sunday (#1312) --- src/components/common/CalendarModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/common/CalendarModal.tsx b/src/components/common/CalendarModal.tsx index ac37744aa..13909ae61 100644 --- a/src/components/common/CalendarModal.tsx +++ b/src/components/common/CalendarModal.tsx @@ -269,7 +269,7 @@ function buildCalendarGrid(year: number, month: number) { date.setMonth(month); date.setDate(1); - const monthStartDay = date.getDay(); + const monthStartDay = date.getDay() || 7; // Fill empty cells for (let i = 1; i < monthStartDay; i++) { grid.push(0);