I have in model DateTime
public System.DateTime date_in { get; set; }
And this is its View:
<div class="form-group">
@Html.LabelFor(model => model.date_in, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.date_in, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.date_in, "", new { @class = "text-danger" })
</div>
</div>
when I just click the EditorFor()
to change the date, It writes:
The field date_in must be a date.
all formats I tried to insert (with time and without and change the places of month and day) were wrong.
The individual way I
succeeded is when month value and day value smaller than 13
I have tried answers people answered on similar questions
like add globalization tag and custom binder
but nothing helped me.