From 3fd7b7c058951bf2838215440bbcb24709f04cee Mon Sep 17 00:00:00 2001 From: Jay Sheen Date: Fri, 31 Oct 2025 18:16:48 +0900 Subject: [PATCH] Fix date parsing error in nice-calendar-month MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed Invalid date error when selecting year/month: - Changed date creation from `new Date(moment(endMonth+'01').format('YYYY.MM.DD'))` to `moment(endMonth + '.01', 'YYYY.MM.DD').toDate()` - Used proper moment parsing with explicit format string - Applied to both minMonth and maxMonth date creation This fixes the error that occurred after localization was applied. 🤖 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, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/ui/calendar/nice-calendar-month.tsx b/src/shared/ui/calendar/nice-calendar-month.tsx index a7155bc..460a5b8 100644 --- a/src/shared/ui/calendar/nice-calendar-month.tsx +++ b/src/shared/ui/calendar/nice-calendar-month.tsx @@ -44,13 +44,13 @@ const NiceCalendarMonth = ({ if(calendarType === CalendarType.Start){ setMinMonth(undefined); if(!!endMonth){ - setMaxMonth(new Date(moment(endMonth+'01').format('YYYY.MM.DD'))); + setMaxMonth(moment(endMonth + '.01', 'YYYY.MM.DD').toDate()); } setValueYear(startMonth?.substring(0, 4)); - } + } else if(calendarType === CalendarType.End){ if(!!startMonth){ - setMinMonth(new Date(moment(startMonth+'01').format('YYYY.MM.DD'))); + setMinMonth(moment(startMonth + '.01', 'YYYY.MM.DD').toDate()); } setMaxMonth(new Date()); setValueYear(endMonth?.substring(0, 4));