How do I disable past dates on jQuery datepicker? I looked for options but don\'t seem to find anything that indicates the ability to disable past dates.
UPDATE: Th
var givenStartDate = $('#startDate').val();
alert('START DATE'+givenStartDate);
var givenEndDate = $('#endDate').val();
alert('END DATE'+givenEndDate);
var date = new Date();
var month = date.getMonth()+1;
var day = date.getDate();
var currentDate = date.getFullYear() + '-' +
(month<10 ? '0' : '') + month + '-' +
(day<10 ? '0' : '') + day;
if(givenStartDate < currentDate || givenEndDate < currentDate)
{
$("#updateButton").attr("disabled","disabled");
}
if(givenStartDate < currentDate && givenEndDate > currentDate)
{
$("#updateButton").attr("enabled","enabled");
}
if(givenStartDate > currentDate || givenEndDate > currentDate) {
$("#updateButton").attr("enabled","enabled");
}
Try this. If any mistake, please correct me :) Thanks all.