From f1e22e944e592236df23209941cfdf6908715dba Mon Sep 17 00:00:00 2001 From: "ashutosh.nehete" Date: Sun, 4 May 2025 12:24:27 +0530 Subject: [PATCH] added on more condition checIn and checkOut are present, and same day, so display slots from chekout to end of that day. --- src/components/common/TimePicker.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/common/TimePicker.jsx b/src/components/common/TimePicker.jsx index 56a0e426..cb76a5d1 100644 --- a/src/components/common/TimePicker.jsx +++ b/src/components/common/TimePicker.jsx @@ -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());