When using jQuery UI Datepicker, we encouter a problem when used in Google Chrome: when we enter a date with a day higher than 12, it does not accept it as a valid date, th
Create a new jquery.validate.date.js file.
Paste the following code inside the file.
$(function () {
$.validator.methods.date = function (value, element) {
if ($.browser.webkit) {
var d = new Date();
return this.optional(element) || !/Invalid|NaN/.test(new Date(d.toLocaleDateString(value)));
}
else {
return this.optional(element) || !/Invalid|NaN/.test(new Date(value));
}
};
});
Now ensure that this file is loaded after jquery.validate.js file.