So I got this controller which is like this:
public ActionResult Create(int teller, DateTime datum, int AfdelingId, int WerknemerId, int KwartaalId)
{
DienstGepland dg = new DienstGepland();
dg.datum = datum.AddDays(teller);
dg.gecontroleerd = false;
dg.WerknemerId = WerknemerId;
dg.DienstKwartaalGeplandId = KwartaalId;
ViewBag.afdelingid = AfdelingId;
ViewBag.diensten = _service.DienstenList(AfdelingId);
return View(dg);
}
dg.datum is filled in like for example: “13/03/2012”.
But when it open the Create View the date in the EditorFor is changed to: “03/13/2012”.
View:
@model ProjectMivalti.Domain.DienstGepland
@Html.EditorFor(model => model.datum)
This may not happen of course. I think it is a culture problem but i have no idea how to fix it.
Thanks in advance!
You can try formatting it like this: