feat: replace single-date picker with unified date range control

This commit is contained in:
root
2025-11-09 19:22:13 +01:00
parent 3f8f1f24eb
commit 4cebada1ed
3 changed files with 273 additions and 252 deletions

View File

@@ -99,10 +99,12 @@ function matchesDesiredDate(pickupDate, desiredDate, desiredDateRange) {
if (hasRange) {
const startValue = toDateValue(desiredDateRange.start);
const endValue = toDateValue(desiredDateRange.end);
if (startValue !== null && pickupValue < startValue) {
const normalizedStart = startValue !== null ? startValue : endValue;
const normalizedEnd = endValue !== null ? endValue : startValue;
if (normalizedStart !== null && pickupValue < normalizedStart) {
return false;
}
if (endValue !== null && pickupValue > endValue) {
if (normalizedEnd !== null && pickupValue > normalizedEnd) {
return false;
}
return true;