jQuery & jQuery UI Documentation

jQuery & jQuery UI

noWeekends

« Back to UI/Datepicker

noWeekends( )

Set as beforeShowDay function to prevent selection of weekends.
We can provide the noWeekends function into the beforeShowDay event which will calculate all the weekdays and provide an array of true/false values indicating whether a date is selectable.


Examples:
Set the DatePicker so no weekend is selectable

$("#datepicker").datepicker({ beforeShowDay: $.datepicker.noWeekends });