From d9ba4097eef2730a11ea8cc7b35c915a71b2fc61 Mon Sep 17 00:00:00 2001 From: Brian Cao Date: Fri, 20 Jan 2023 12:33:21 -0800 Subject: [PATCH] Fix calendar. --- components/common/Calendar.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/common/Calendar.js b/components/common/Calendar.js index b6c5cd0b..e9e22573 100644 --- a/components/common/Calendar.js +++ b/components/common/Calendar.js @@ -123,7 +123,8 @@ const DaySelector = ({ date, minDate, maxDate, locale, onSelect }) => { } const days = []; - for (let i = 0; i < 35; i++) { + const weekCount = addDays(startDay, 36).getMonth() === month ? 42 : 35; + for (let i = 0; i < weekCount; i++) { days.push(addDays(startDay, i)); }