I have a property
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:hh:mmtt}")]
public DateTime DeadlineTime { get; set; }
use it on page
<div class="form-group">
@Html.LabelFor(model => model.DeadlineTime, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.DeadlineTime, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.DeadlineTime, "", new { @class = "text-danger" })
</div>
</div>
but when I try to enter the value like : 11:30PM I get a validator error:
The field DeadlineTime must be a date.
why and how to solve it?