Menu
I have a variable that is holding a date object and I have another variable that is entered by a user which has been converted into date format.
I am having problems Date checking because todays date is holding a time as well and not the time from midnight. below is roughly the code…
[code]
var todaysDate = new Date();
var enteredDate; // has been set
if (enteredDate < todaysDate) {
alert(“The date must be today or in the future.”);
return false;
}
If the dates are the same then it is passing so I need to truncate the todaysDate. I did todaysDate.setTime(0) but it sets it to 1970.
How do you do this?