Disable future dates in jQuery UI Datepicker

cicakman picture cicakman · Oct 23, 2010 · Viewed 107.1k times · Source

Is it possible to disable future date from today?

Let say today is 23/10/2010, so 24/10/2010 onwards are disabled.

Sorry I am very new in jQuery and JavaScript.

Answer

Cyril Gupta picture Cyril Gupta · Oct 23, 2010

Yes, indeed. The datepicker has the maxdate property that you can set when you initialize it.

Here's the codez

$("#datepicker").datepicker({ maxDate: new Date, minDate: new Date(2007, 6, 12) });