How can I disable the item Editor for and enable writing only from 4pm to 11:59 pm in an ASP.NET MVC view?
This is the control markup:
<div class="form-group">
@Html.LabelFor(model => model.TESTS_EVENING, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.TESTS_EVENING, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.TESTS_EVENING, "", new { @class = "text-danger" })
</div>
</div>
How to use:
If Datetime.Now between 16:00 and 23:59
then enable the item, else disable it.