pickedDate = new Date(Date.parse(txtDate.value.replace(/-/g, ' ')));
todaysDate = new Date();
todaysDate.setHours(0, 0, 0, 0)
if (todaysDate == pickedDate)
{
return true;
}
else
{
return false;
}
I’m checking if picked date and today’s date are equal and then returning true if they’re equal or false if they’re not, but condition is always false when i run the code.
Test the following condition:
This should test for equality, because the getTime() method returns the Unix time of the object (as an integer) which can be compared against each other.