The bookings datepicker is not aware of open/closed days at present and as such a booking may be made that would expect fulfilment or return on a closed day. We should update the flatpickr to disable such dates for direct selection, but allow spanning them.
Flatpickr doesn't appear to support this spanning functionality natively.. there are a few idea's here though: https://github.com/flatpickr/flatpickr/issues/955
This works from onDayCreate: ``` // Make closed days unclickable (while keeping them part of the range) if (date.getDay() === 0 || date.getDay() === 6) { dayElem.classList.add("closed-day"); // Remove the click event to disable the day dayElem.addEventListener('click', function(event) { event.stopImmediatePropagation(); }, true); } ``` I'll submit the patch once I've finished work on bug 34440
Created attachment 169687 [details] [review] Bug 37363: Initial work on supporting closed days This is just a proof of concept at this point.. we need api's for fetching regular and irregular closed days before we can fully impliment the functionality.
This is of interest to a library we work with: they use the Tools > Calendar to mark closed days and would like to see those closed days greyed out when placing bookings.
The main blocker here is the lack of API's for fetching calendar open/closed days. We need to work on that first and also consider how opening hours and days work together.