fix: disallow selecting dates in the past or today

This commit is contained in:
2026-08-12 13:38:08 +02:00
parent 54420cf25a
commit 192933c9b6
2 changed files with 12 additions and 6 deletions
+3 -2
View File
@@ -50,7 +50,7 @@
const upcoming = Array.from(availableDatesMap.keys())
.map((dateKey) => new Date(`${dateKey}T00:00:00`))
.filter((date) => date >= today)
.filter((date) => date > today)
.sort((a, b) => a - b);
if (upcoming.length > 0) {
@@ -88,7 +88,8 @@
button.textContent = String(day);
const dateInfo = availableDatesMap.get(key);
const isAvailable = Boolean(dateInfo);
const isPastOrToday = cellDate <= today;
const isAvailable = Boolean(dateInfo) && !isPastOrToday;
const isToday = cellDate.getTime() === today.getTime();
const isSelected = selectedDate && cellDate.getTime() === selectedDate.getTime();