I want to filter the selectable dates on a datepicker. I basically need to filter by work days - i.e. make holidays and weekends not selectable.
I know you can specify dates using a function in the beforeShowDate: and you can also use $.datepicker.noWeekends.
Question is: can you do both?
$.datepicker.noWeekends is a pretty simple bit of code:
function (date) {
var day = date.getDay();
return [day > 0 && day < 6, ""];
}
Since you're going to have to write up the function for holidays, you can just include this logic in that function too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With