fix: Month scroll navigates by full month, not by week

Scrolling in month view was moving currentDate by 7 days, but the
grid always renders the complete month — so 4 scrolls were needed
before any visual change. Now each scroll step advances/retreats
by exactly one month (same as the prev/next buttons).
This commit is contained in:
Guido Schmit
2026-04-07 21:51:15 +02:00
parent e2f98520e2
commit 46f6765087

View File

@@ -551,8 +551,8 @@ function bindTopbar() {
const dir = e.deltaY > 0 ? 1 : -1;
if (state.currentView === 'agenda') return;
if (state.currentView === 'month') {
state.currentDate = new Date(state.currentDate);
state.currentDate.setDate(state.currentDate.getDate() + dir * 7);
const d = state.currentDate;
state.currentDate = new Date(d.getFullYear(), d.getMonth() + dir, 1);
fetchAndRender();
} else {
navigate(dir);