Jump to content

Validate Todays Date And Beyond


justinbriggs1

Recommended Posts

One way is to get the current date and set the time to be midnight (i.e. "0:00:00.000"):

var today = new Date();today.setHours(0);today.setMinutes(0);today.setSeconds(0);today.setMilliseconds(0);

Then you could compare your date with "today":

if(myDate > today){	alert("valid!");}else{	alert("get out of the past!");}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...