check if string is valid date javascript code example
Example 1: check if string is datestring javascript
moment("2015-06-22T13:17:21+0000", moment.ISO_8601, true).isValid(); // true
Example 2: javascript validate date
var date_regex = /^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$/;
if (!(date_regex.test(testDate))) {
return false;
}