I'm having problems with setting validations date format Chrome in asp.net mvc, for other browsers like IE,Firefox works correctly .
I have defined dates in my model like next code:
[Required]
[Display(Name = "Data fi publicació")]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
public DateTime PublishingEndDate { get; set; }
And in my views :
@Html.TextBoxFor(model => model.PublishingEndDate)
@Html.ValidationMessageFor(model => model.PublishingEndDate)
The problem It seems that @Html.ValidationMessageFor
, validates the date with format MM/dd/yyyy
, but what I want is to validate with european format dd/MM/yyyy
. How can I change default culture validations format date to dd/MM/yyyy
?
Thanks for your help