Created
January 11, 2017 14:58
-
-
Save pelusium/03ad3b23fed1e9773a3d9aab1826db66 to your computer and use it in GitHub Desktop.
Jquery validator over 16 years
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.validator.addMethod('isOver16', function(value, element) { | |
var birthDate = value.split('-'); | |
var tempDate = new Date((parseInt(birthDate[2])+16), parseInt(birthDate[1]-1), parseInt(birthDate[0])); | |
return (tempDate <= new Date()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment