This is my code and it is not working correctly. I want to set minDate to the current date. How can I do it?
$(\"input.DateFrom\").datepicker({
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