feat: replace single-date picker with unified date range control
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user