Skip to content

Instantly share code, notes, and snippets.

@maxparm
Created April 9, 2012 17:38
Show Gist options
  • Save maxparm/2344922 to your computer and use it in GitHub Desktop.
Save maxparm/2344922 to your computer and use it in GitHub Desktop.
JS - Validate Date mm/dd/yyyy
function isDate(date) {
return /^(0[1-9]|1[012])[- \/\/.](0[1-9]|[12][0-9]|3[01])[- \/\/.](19|20)\d\d$/.test(date);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment