jQuery datepicker: Disabled previous/next/any days

We have seen how to customize jquery datepicker in different condition. such as,

jQuery calender: Highlight date with different color
jQuery datepicker: change position of month and year drop down
jQuery Calender: Manage Year Range
jQuery Calender: Include month and year dropdown
jQuery Datepicker

Here today I am going to explain how to disabled previous days, next days or disabled any week days. As I mentioned jQuery datepicker is highly customize so that you just need to pass parameter to disabled previous and next day. In order to disabled any week day you need to write condition on beforeshowday function. Let’s see one by one.

How to disabled previous days or you can say passed days?

jQuery(‘div’).datepicker({‘minDate’ : 0});




How to disabled next days or you can say future days?

jQuery(‘div.maxdate’).datepicker({‘maxDate’ : 0});



How to disabled any week days? disabled saturday and sunday.

beforeShowDay : function(date){
if(date.getDay() == 0 || date.getDay() == 6){
return [false];
return [true];



A full example:

[gist id=”8394694″]

Leave a Reply

Your email address will not be published. Required fields are marked *