Is it possible to set a minimum and maximum selectable date/datetime for Html.EditorFor?
@Html.EditorFor(model => model.Date)
If yes, how?
Is it possible to set a minimum and maximum selectable date/datetime for Html.EditorFor?
@Html.EditorFor(model => model.Date)
If yes, how?
I looked into the suggestions in comments and it worked (kindof) by using the [DataType(DataType.DateTime)] attribute on the model property in combination with
@Html.EditorFor(model => model.Date, new { htmlAttributes = new { @min= "2021-05-19" } })
However that gave me issues with formatting and submitting my form.. i ended up handling the date validation in the controller..