Block calendar swiping outside possible range

This commit is contained in:
2026-04-20 22:22:51 +02:00
parent 570e44257f
commit 63937ed7d1
2 changed files with 34 additions and 6 deletions

View File

@@ -313,6 +313,11 @@ function bindPantryCalendarInteractions() {
if (nextAnchor.getTime() < minAnchor.getTime()) return;
calendarMonthAnchor = nextAnchor;
},
canNavigateToMonth: (nextMonth) => {
const nextAnchor = startOfMonth(nextMonth);
const minAnchor = startOfMonth(getToday());
return nextAnchor.getTime() >= minAnchor.getTime();
},
getSelectionKeys: () => dateKey(horizonEndDate),
onSelectionCommit: (selectedKey) => {
selectHorizonDate(new Date(`${selectedKey}T00:00:00`));