From 4e5e0a8760310827191824a9a0a3eb005531efbd Mon Sep 17 00:00:00 2001 From: Jay Sheen Date: Fri, 31 Oct 2025 18:43:07 +0900 Subject: [PATCH] Add undefined fallback for valueMonth state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added else clauses to set valueMonth to undefined when month values are not provided: - Prevents stale date values in calendar - Ensures calendar displays correctly when switching between date ranges 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/shared/ui/calendar/nice-calendar-month.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/shared/ui/calendar/nice-calendar-month.tsx b/src/shared/ui/calendar/nice-calendar-month.tsx index 349f994..8bdfc64 100644 --- a/src/shared/ui/calendar/nice-calendar-month.tsx +++ b/src/shared/ui/calendar/nice-calendar-month.tsx @@ -55,6 +55,8 @@ const NiceCalendarMonth = ({ if (startDate.isValid()) { setValueMonth(startDate.toDate()); } + } else { + setValueMonth(undefined); } } else if(calendarType === CalendarType.End){ @@ -71,6 +73,8 @@ const NiceCalendarMonth = ({ if (endDate.isValid()) { setValueMonth(endDate.toDate()); } + } else { + setValueMonth(undefined); } } else if(calendarType === CalendarType.Single){ @@ -79,6 +83,8 @@ const NiceCalendarMonth = ({ if (singleDate.isValid()) { setValueMonth(singleDate.toDate()); } + } else { + setValueMonth(undefined); } } };