From b12e4498d8599d6764d76201ffbb2a4d2f2e9ee1 Mon Sep 17 00:00:00 2001 From: Akash Das <76689571+akash70629@users.noreply.github.com> Date: Tue, 22 Oct 2024 23:45:27 +0530 Subject: [PATCH] Clock Room Booking calendar validation added --- frontend/src/Pages/booking.jsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/Pages/booking.jsx b/frontend/src/Pages/booking.jsx index f20a690..f9d5c22 100644 --- a/frontend/src/Pages/booking.jsx +++ b/frontend/src/Pages/booking.jsx @@ -186,6 +186,11 @@ const BookingPage = () => { // Render booking form for selected service const renderBookingForm = () => { + +// Calender validation code start + const [minDate, setMinDate] = useState(new Date().toISOString().split('T')[0]); +// Calender validation code end + if (!selectedService) return null; if (selectedService === "cloak") { @@ -211,6 +216,7 @@ const BookingPage = () => { setFormData({ ...formData, startDate: date })} + minDate={minDate} // Setting minimum date to today className="w-full px-4 py-2 mt-2 transition duration-200 border border-blue-300 rounded-lg focus:ring-2 focus:ring-blue-400" /> @@ -219,6 +225,7 @@ const BookingPage = () => { setFormData({ ...formData, endDate: date })} + minDate={minDate} // Setting minimum date to today className="w-full px-4 py-2 mt-2 transition duration-200 border border-blue-300 rounded-lg focus:ring-2 focus:ring-blue-400" />