Disable specific day in Jquery date picker
I want to disable all days with out Monda开发者_StackOverflowy and Friday in Jquery date picker. How to do it?
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/
精彩评论