I want to disable Sundays in jQuery UI calendar.
From docs I came to know about this:--
$('#datepicker').datepicker({ minDate: 4,beforeShowDay: $.datepicker.noWeekends });
This will disable Saturdays and Sundays both. But I want to diasble only Sunday. Is there any default option for this.
Bad way to solve it
beforeShowDay take true or false as params for every day. So write a function which returns true or false based upon each day.
To disable the weekends in Bootstrap Datepicker you need to set the daysOfWeekDisabled property value to [0, 6]. Then all the Weekends will be disabled in the datepicker control. Check this example.
To disable the weekends in jQuery UI Datepicker you need to set the beforeShowDay property value to $. datepicker. noWeekends. Then all the Weekends will be disabled in the date picker control.
try this
$("#datepicker").datepicker({ beforeShowDay: function(date) { var day = date.getDay(); return [(day != 0), '']; } });
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