0
$.validator.addMethod("validDate", function (value, element) {
    return this.optional(element) || /(^(((0[1-9]|[12][0-8])[-](0[1-9]|1[012]))|((29|30|31)[-](0[13578]|1[02]))|((29|30)[-](0[4,6,9]|11)))[-](19|[2-9][0-9])\d\d$)|(^29[-]02[-](19|[2-9][0-9])(00|04|08|12|16|20|24|28|32|36|40|44|48|52|56|60|64|68|72|76|80|84|88|92|96)$)/i.test(value);
}, "Please enter valid Date.");

This regular expression is not working for some date formate example 19-02-2015, 19-03-2015, 19-04-2014 ..... etc only for start with 19. thank you so much.

0 Answers0