开发者

Disable specific day in Jquery date picker

开发者 https://www.devze.com 2023-03-26 13:06 出处:网络
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 wha

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/

0

精彩评论

暂无评论...
验证码 换一张
取 消