Block calendar swiping outside possible range
This commit is contained in:
@@ -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`));
|
||||
|
||||
Reference in New Issue
Block a user