In my ASP.NET MVC 4 project I have a DateOfBirth field that uses the DataAnnotations Validation Date Attribute...
[Required(ErrorMessage = "This field is required"), Date]
public DateTime DateOfBirth { get; set; }
I have set the format of my DatePicker control to dd-MM-yyyy (default was yyyy-MM-dd). But when I submit the form I am told that the date format is not valid.
dd-MM-yyyy is a valid date format so why would it complain? Is there any way to fix this?
Thanks