I have a legacy MVC application, which has an input date field;
@Html.EditorFor(model => model.CompleteBy)
which is decorated in the ViewModel as
[Display(Name = "Complete By")]
[DataType(DataType.Date)]
public Nullable<DateTime> CompleteBy { get; set; }
I have an EditorTemplate for date fields;
@model DateTime?
@Html.TextBox("", (Model.HasValue ? Model.Value.ToLongDateString() : string.Empty),
new { @class = "datePicker", @style = "width:200px;" })
And in my Javascript file I assign a datepicker to the datepicker class as follows;
var constantDateFormat = "dd MM yy";
$("input[type=date]").datepicker({
showOn: "both",
dateFormat: constantDateFormat,
changeMonth: true,
changeYear: true
});
When this application is accessed in Edge, the date no longer appears, instead I see mm/dd/yyyy. And the datepicker is completely different to before.
So how do I fix this for Edge?