Check if a date is valid
Say I have three variables: month, year and day. How do I check whether they form a valid date, i.e. not "Februrary 31 1999"?
This isn't an answer but hello Mr. Proton. It's a small world.
wtf? What does that have to do with my question?
Oh wait, hi Ninconvert!
Well this is something I have been thinking about. The Date object allows you to pass parameter that equal a date.
So if you pass the string entered in the form to the date object it will return either NaN or another error.
var someDate=new Date("sept 22,0")
hat would be an error...
Play around with that...
Thanks, but I already found something.
By the way, what is this NaN anyway?
Not a Number...it is a error point like when something returns false of -1