added on more condition checIn and checkOut are present, and same day, so display slots from chekout to end of that day.
This commit is contained in:
parent
cb2950338c
commit
8e04dd2191
@ -69,8 +69,10 @@ const TimePicker = ({ label, onChange, interval = 10, value,checkInTime, checkOu
|
|||||||
}
|
}
|
||||||
} else if (checkInDate && checkOutDate) {
|
} else if (checkInDate && checkOutDate) {
|
||||||
// Case 3: Both check-in and checkout present
|
// Case 3: Both check-in and checkout present
|
||||||
|
const isSameDay = new Date(checkOutDate).toDateString() === new Date().toDateString();
|
||||||
minSelectable = new Date(checkOutDate);
|
minSelectable = new Date(checkOutDate);
|
||||||
maxSelectable = new Date(currentSlot);
|
maxSelectable = isSameDay ? new Date(dayEnd) : new Date(currentSlot);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const slot = new Date(dayStart.getTime());
|
const slot = new Date(dayStart.getTime());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user