I need to capture date and time both for my model property. In my model class I have the following
[Required] [DataType(DataType.DateTime)] public DateTime?
I added the fix for date format parser, but I needed to set the format to 'L' so it could be work in all Locales:
$(function () { $.validator.methods.date = function (value, element) { return this.optional(element) || moment(value, "L", true).isValid(); } });