Jump to content

Validate Todays Date And Beyond


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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...