From 8e04dd21911a88ef29cf3377a389415d374c0ed2 Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Fri, 2 May 2025 14:25:10 +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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/common/TimePicker.jsx b/src/components/common/TimePicker.jsx index f0a67f56..2461277a 100644 --- a/src/components/common/TimePicker.jsx +++ b/src/components/common/TimePicker.jsx @@ -69,8 +69,10 @@ const TimePicker = ({ label, onChange, interval = 10, value,checkInTime, checkOu } } 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());