Saturday, May 30, 2015

Exclude weekends on jQuery datepicker

$('yourSelector').datepicker({
    minDate: 0, // your min date
    maxDate: '+1w', // one week will always be 5 business day - not sure if you are including current day
    beforeShowDay: $.datepicker.noWeekends // disable weekends
});

Disable all Sundays in jQuery UI Calendar (datepicker)

$("#datepicker").datepicker({
    beforeShowDay: function(date) {
        var day = date.getDay();
        return [(day != 0), ''];
    }
});