I am wanting to set this jquery date picker to throw an alert / dialog if the date selected is todays date. I am using smarty, thats the date function you see. However when I input todays date, the script will still not return the dialog that represents today. Here is the script:
$("#sanctionDateStart").datepicker({
altField: "#sanctionDateStart_hidden",
altFormat: "yy-mm-dd",
minDate: new Date()
}).datepicker("setDate", "{$data.sanctionDateStart}").change(function () {
$('#sanctionDateEnd').datepicker('option', 'minDate',
$(this).datepicker('getDate'));
if ($(this).datepicker('getDate') == '{date("m/d/Y", $smarty.now)}'){
alert ('Todays Date');
}
else {
alert ('Not Todays Date');
}
});
Use Datepicker onSelect instead of .change