Reputation: 4330
I want to disable all days with out Monday and Friday in Jquery date picker. How to do it?
Upvotes: 1
Views: 1056
Reputation: 15853
What threw you off might be the hidden $.datepicker.noWeekends
method, which is really what you're after. So, what you really need to do is:
$("#datepicker").datepicker({
beforeShowDay: function (date) {
var day = date.getDay();
return [(day == 1 || day == 5), ''];
}
});
See example: http://jsfiddle.net/william/fsEpP/2/
Upvotes: 3