justinbriggs1 Posted December 31, 2008 Share Posted December 31, 2008 Hello, I have a date format validation working correctly, but I was wondering how to confirm that a date is equal to today's date or later. Any ideas? Thanks.JW Link to comment Share on other sites More sharing options...
jesh Posted December 31, 2008 Share Posted December 31, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.