I would like to add an ‘available from’ and ‘available until’ date picker to my site to enable users to filter CMS collection items based on two dates.
I noticed this thread and wondered if it would be possible to achieve this with the date picker discussed above?
Flowbase has a date picker that’s much more intuitive as well as customizable. The setup was extremely simple and the explanation on their blog is very easy to follow. Use it!
To disable certain days in the jQuery UI Datepicker, you can use the beforeShowDay option. This option allows you to define a function that is called for each day in the calendar, where you can determine whether a day should be enabled or disabled by returning an array with two values: a boolean indicating if the day is enabled (true for enabled, false for disabled), and a CSS class to style the disabled days.
Example of how you can disable specific days using the beforeShowDay option: