I have researched this issue extensively and still can't find an answer. I have a model with this date field:
[Display(Name = "Start Date")]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:d}", NullDisplayText = "")]
[Required]
public Nullable<System.DateTime> ConsumptionDate;
I have a view with this EditorFor:
@Html.EditorFor(model => model.ConsumptionDate)
@Html.ValidationMessageFor(model => model.ConsumptionDate, "*", new { @class = "text-danger" })
But the date still never gets formatted. I have tried with and without "{0:d}" as the format in the EditorFor, and I have tried with and without [DataType(DataType.Date)] annotated on the model field. Any ideas what I'm doing wrong? The binding works fine and I can save the data fine too - I just can't get it to format properly.
TIA -VG