Skip to content

Commit

Permalink
Merge pull request #147 from garikAsplund/garik-onChangeMonth
Browse files Browse the repository at this point in the history
updated onChangeMonth to handle all rollovers
  • Loading branch information
mskocik authored Nov 5, 2023
2 parents 9f3cab0 + e967c10 commit 43f2465
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/components/Calendar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 43f2465

Please sign in to comment.