People make me want to cry when they validate date using regular expression.
IMHO, its much simpler to use Date.Parse. For example,
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
IMHO, its much simpler to use Date.Parse. For example,
var myDateString = '01-Aug-12'; var isValidDate = !isNaN( Date.parse( myDateString ));Happy Coding!
Read more...