diff --git a/frontend/src/components/calendar/CalendarSidebar.tsx b/frontend/src/components/calendar/CalendarSidebar.tsx index 4dbeb79..7cac30a 100644 --- a/frontend/src/components/calendar/CalendarSidebar.tsx +++ b/frontend/src/components/calendar/CalendarSidebar.tsx @@ -99,6 +99,9 @@ const CalendarSidebar = forwardRef(functio return (
+
+ Calendars +
{onDateClick && (
currentDate ? startOfMonth(parseDate(currentDate)) : startOfMonth(new Date()) ); - const [selectedDate, setSelectedDate] = useState( - currentDate ?? null - ); + const [selectedDate, setSelectedDate] = useState(null); // Sync displayed month when main calendar navigates across months + // selectedDate is only set by user clicks in the mini calendar, not by external navigation useEffect(() => { if (!currentDate) return; const incoming = startOfMonth(parseDate(currentDate)); setDisplayedMonth((prev) => prev.getTime() === incoming.getTime() ? prev : incoming ); - setSelectedDate((prev) => prev === currentDate ? prev : currentDate); }, [currentDate, parseDate]); const days = useMemo(