Kendo DatePicker fails validation for custom date format

前端 未结 6 1175
孤城傲影
孤城傲影 2021-02-02 11:48

I\'m using Kendo DatePicker to edit a Date field being displayed in a Kendo Grid in my ASP.NET MVC 4 project. In order to have the DatePicker being used for the Date field use c

6条回答
  •  梦毁少年i
    2021-02-02 12:06

    I changed the date validation rule:

    $.validator.methods.date = function (value, element) {
        return this.optional(element) || /^\d\d?-\w\w\w-\d\d\d\d/.test(value);
    };
    

    My format is slightly different than yours but you should be able to modify this.

提交回复
热议问题