From e967c10fbb2a2c8352eb90551a363b97a29d533e Mon Sep 17 00:00:00 2001 From: Garik Asplund Date: Sat, 4 Nov 2023 21:14:37 -0700 Subject: [PATCH] updated onChangeMonth to handle all rollovers --- src/lib/components/Calendar.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/components/Calendar.svelte b/src/lib/components/Calendar.svelte index 5088d9a..767d534 100644 --- a/src/lib/components/Calendar.svelte +++ b/src/lib/components/Calendar.svelte @@ -158,6 +158,7 @@ : 1 ) const newActiveDate = new Date(activeDate); // to keep it working with immutable setting, ref #20 + newActiveDate.getDate() > 28 ? newActiveDate.setDate(newActiveDate.getDate() - 3) : newActiveDate; newActiveDate.setMonth(activeDate.getMonth() + (val*multiplier)); activeDate = newActiveDate; onMonthTransitionTrigger = null;