how to disable past date in jquery datepicker

hey guys,

here is simple code for disable past date in jquery datepicker.

Declare todaydate variable and use Date() function to set it.. then use that variable to assign to minDate which is parameter of datepicker. you can also change numberofMonths according to your requirement.

numberOfMonths: 3,

oky lets go for code.

 var dateToday = new Date();
  $(function() {
   $( "#datepicker" ).datepicker({
        numberOfMonths: 1,
        showButtonPanel: true,
        minDate: dateToday

html code

Date: <input type=”text” id=”datepicker” />


Hope you like it.! đŸ™‚


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s