This is common date validation error in Firefox, Chrome, Safari and Internet Explorer when you are creating ASP MVC Mobile Application Here is the solution to solve it.
1- Add follow tag in web.config
<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="sv-SE" uiCulture="sv-SE"/>
2- Open JQuery file as shown in picture and add following code.
$.validator.methods.date = function (value, element) {
return this.optional(element) || (/^(19[0-9]{2}|2[0-9]{3})-(0[1-9]|1[012])-([123]0|[012][1-9]|31)[ \/T\/t]([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9]))?$/.test(value)
);
}
Reference:
http://stackoverflow.com/questions/14476104/altering-my-datetime-regular-expression-to-make-entering-seconds-optional
No comments:
Post a Comment