How to set minDate to current date in jQuery UI Datepicker? How to set minDate to current date in jQuery UI Datepicker? jquery jquery

How to set minDate to current date in jQuery UI Datepicker?


You can specify minDate as today by adding minDate: 0 to the options.

$("input.DateFrom").datepicker({    minDate: 0,    ...});

Demo: http://jsfiddle.net/2CZtV/

Docs: http://jqueryui.com/datepicker/#min-max


You can use the minDate property, like this:

$("input.DateFrom").datepicker({    changeMonth: true,     changeYear: true,     dateFormat: 'yy-mm-dd',    minDate: 0, // 0 days offset = today    maxDate: 'today',    onSelect: function(dateText) {        $sD = new Date(dateText);        $("input#DateTo").datepicker('option', 'minDate', min);    }});

You can also specify a date, like this:

minDate: new Date(), // = today


Use this one :

 onSelect: function(dateText) {                 $("input#DateTo").datepicker('option', 'minDate', dateText);            }

This may be useful :http://jsfiddle.net/injulkarnilesh/xNeTe/