This project is read-only.

Formatting date returned in an HTMLEditor

Jun 3, 2015 at 2:24 PM

I have a date I'm pulling from SQL. In SQL it is in the format dd-mm-YYYY, so on my index return I have the following column properties:
         columns.Add(model => model.DOB).Titled("DOB").Format("{0:dd/MM/yyyy}").SetWidth(110).Sortable(true);
I tried appending the same property to the edit page in this section:
            @Html.DisplayNameFor(model => model.DOB)

            @Html.EditorFor(model => model.DOB)
            @Html.ValidationMessageFor(model => model.DOB)

But obviously got a compilation error. What's the easiest way to get this looking how I want it to. At the moment in the editor it appears like this:
         DOB: {04/04/1904 00:00:00}
Jun 10, 2015 at 10:54 AM
For info, I ended up using this:
            @Html.TextBoxFor(model => model.DOB, "{0:dd-MM-yyyy}")
            @Html.ValidationMessageFor(model => model.DOB)