2

I'm wondering if there's a method or option in JQuery datepicker to disable days in the calendar, or even a way to perhaps disable days so that choosing a month is enough to set the date.

Can't seem to find anything that does the job @ http://api.jqueryui.com/datepicker/#option-navigationAsDateFormat

I have a non-paying client who requested this, so would rather keep on using the datepicker component rather than try and re-engineer an input (dual input asi t would be due to them needing MM/YY).

Any help with this could be considered my christmas and birthday gifts combined.

Cheers in advance!

4

2 回答 2

2

你可以参考http://davidwalsh.name/jquery-datepicker-disable-days做希望它可以帮助你

于 2012-12-19T10:50:27.330 回答
0

你可以使用beforeShowDate eventdatepicker 的结合Date.getDay()来做你想做的事,像这样:

​$("#datepicker").datepicker({
    beforeShowDay: function(date) {
        var day = date.getDay();
        return [(day != 1 && day != 2)];
    }
})​​​​​;​
于 2012-12-19T11:03:24.300 回答