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
213ca4067e
commit
f1e22e944e
@ -76,8 +76,9 @@ const TimePicker = ({ label, onChange, interval = 10, value,checkInTime,checkOut
|
||||
}
|
||||
} else if (checkInDate && checkOutDate) {
|
||||
// Case 3: Both check-in and checkout present
|
||||
const isSameDay = new Date(checkOutDate).toDateString() === new Date().toDateString();
|
||||
minSelectable = new Date(checkOutDate);
|
||||
maxSelectable = new Date(currentSlot);
|
||||
maxSelectable = isSameDay ? new Date(dayEnd) : new Date(currentSlot);
|
||||
}
|
||||
|
||||
const slot = new Date(dayStart.getTime());
|
||||
|
Loading…
x
Reference in New Issue
Block a user