Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Determine if a string is a validate Date
Date.valid = function(str){
var d = new Date(str);
return ( === "[object Date]" && !isNaN(d.getTime()));
Date.valid=function(a){var b=new Date(a);return"[object Date]"!isNaN(b.getTime())};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment