All,
I\'m using the jQuery UI for the date picker. I\'m trying to check with javascript though that the date the user has entered is in the past. Here is my form code:
$('#datepicker').datepicker().change(evt => {
var selectedDate = $('#datepicker').datepicker('getDate');
var now = new Date();
now.setHours(0,0,0,0);
if (selectedDate < now) {
console.log("Selected date is in the past");
} else {
console.log("Selected date is NOT in the past");
}
});