With Asp.Net MVC 4.5, I have a model with a DateTime?
property. I have used the javascript datepicker, with the current culture, to set the date. It all seems to be working as far as setting the date. The problem comes during validation. If the culture is one in which the format is dd/mm/yyyy
, and the day is > 12, I get a validation error, client side. The strange thing is, I can't figure out where the validation is coming from. I am using fluent validation. The definition of the field is
//[DataType(DataType.Date)]
[Display(Name = "Birthday", ResourceType = typeof(Resource1))]
public DateTime? Birthday { get; set; }
(I removed the DataType in case that's where the validation was coming from). My fluentvalidation rules have no rule for the Birthday field. So, who is generating the client-side validation, and how can I suppress it (or better yet, make sure it's validated correctly for the current culture)?
Edit: I'm using the jqueryui datepicker https://jqueryui.com/datepicker/