I have a jQuery datetime picker.
This is the property of the model:
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
[DisplayName("Birth date (DD/MM/YYYY)")]
public DateTime? BirthDate { get; set; }
The code in the view:
@Html.TextBoxFor(m => m.Employee.BirthDate, new { @class = "dpTextBox" })
some javascript:
$(".dpTextBox").datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'dd/mm/yy'
});
$.datepicker.setDefaults($.datepicker.regional['nl']);
In Internet Explorer, it works fine. In Chrome it doesn't. The validation error is "The field Birth date (DD/MM/YYYY) must be a date." The language of Chrome is English. When I change the language to Dutch, it works fine, but I want the UI of Chrome in English...