From 4fb75485241e35febffb3c885ed22a199eed4a7e Mon Sep 17 00:00:00 2001 From: Jess Sullivan Date: Fri, 1 May 2026 13:59:01 -0400 Subject: [PATCH] fix: clear date selection on month navigation --- src/components/DateTimePicker.svelte | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/DateTimePicker.svelte b/src/components/DateTimePicker.svelte index 3445960..1512ee0 100644 --- a/src/components/DateTimePicker.svelte +++ b/src/components/DateTimePicker.svelte @@ -95,14 +95,21 @@ onMonthChange?.(formatDate(start), formatDate(end)); }; + const clearDateTimeSelection = () => { + selectedDate = undefined; + selectedTime = undefined; + }; + // Navigate months const prevMonth = () => { currentMonth = new Date(currentMonth.getFullYear(), currentMonth.getMonth() - 1, 1); + clearDateTimeSelection(); emitMonthRange(currentMonth); }; const nextMonth = () => { currentMonth = new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1, 1); + clearDateTimeSelection(); emitMonthRange(currentMonth); };