ReDI-School / F24-Berlin-Web-Circle

6 stars 3 forks source link

Feature/date range #271

Closed grabinskij closed 2 weeks ago

grabinskij commented 2 weeks ago

This PR introduces a dynamic Calendar component that allows users to select check-in and check-out dates for bookings. The component includes the following features:

Initial View of the Calendars:

initial

Once a check-in date is selected, all previous dates and dates after already booked dates automatically become unavailable for check-out, ensuring the user can only select valid dates within the available range

selectedCheckIn

If the user tries to select checkout date or checkIn date before already booked dates in range less than the minimum stay requirements, a tooltip appears with an informational message.

forbidCheckout tooltipBeforeBooked

The day before already booked range is of course for checkout only:

checkoutOnly

The days between the selected check-in and check-out dates are styled to visually highlight the range. Additionally, both the check-in and check-out dates have their own individual tooltips on hover. The dates are calculating avery time chekIn and checkOut were selected.

chekInOutBetween

The calendar is synchronized with the input fields in both directions, meaning any changes in the calendar automatically update the inputs, and any changes in the inputs reflect on the calendar.

sync

The calendars in the SearchBar are designed solely for picking dates without synchronization with the input fields and tabs for now. It was prepared for future development, including adding filter functionality.

searchBarCalendarStay searchBarCalendarExperience