Similiar question like this one. I have a datepicker field in an ASP.NET Core razor page which I would like to format in Germany-style: dd.MM.yyyy
(14.05.2019). However, all my formatting seems to get ignored.
I have already this on my model:
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:dd.MM.yyyy}", ApplyFormatInEditMode = true)]
public DateTime? DateFilter { get; set; }
And this in my view:
<input asp-for="DateFilter" class="form-control" asp-format="{0:dd.MM.yyyy}" />
Nevertheless in Chrome the picker gets displayed as MM/dd/yyyy
. In Edge it shows as dd/MM/yyyy
Chrome:
Edge:
I even tried to set the default culture in my Startup.cs with no effect
options.DefaultRequestCulture = new RequestCulture(culture: "de-DE", uiCulture: "de-DE");
Any ideas what I'm still missing? Thanks!