In this episode, we're improving our date picker by disabling any dates that are unavailable for booking. This way, users can't accidentally try to book on days when nobody's free.
We start off by introducing the EasePick "Lock" plugin, which lets us set rules for which dates should be disabled in our calendar. First, we make sure all past dates are unpickable—no time travel bookings here! Then, we hook up the date picker to use our dynamic availability, so only days with actual open slots will be selectable.
We walk through formatting the dates properly and setting up the filtering logic that checks if each calendar date matches an available date in our data. After that, we fix a small issue to ensure we only include dates that have at least one available slot.
To test this out, we create a schedule exclusion for a specific employee to make sure the logic works—for example, blocking off a Wednesday for Alex but still showing availability if someone else (like Mabel) can cover the appointment. This way, the system smartly disables fully-booked days while still allowing bookings with any qualified staff.
By the end, we've made our calendar much smarter, only showing truly available days, which makes for a much smoother booking experience. Now, we’re ready to tackle continuous loading of availability as users browse ahead in the calendar!