I have aps.net MVC project, where I have to set the range of date inputs on user side, I am doing this manually with jquery scripts. Today found html 5 attributes min and max, which work great with restriction date values, the error is shown in @Html.ValidationMessageFor
element, but the only trouble is - I cant localize it.
Code i have now for my date field:
<td>@Html.EditorFor(m => m.EndDate, new { htmlAttributes = new { @class = datepicker" ", id = "EditorForTillDate", max@="20.12.2018" } })</td>
<td style="width:10%">@Html.ValidationMessageFor(m => m.EndDate, "", new { @class = "text-danger" })</td>
and model:
[Display(Name = "end_date", ResourceType = typeof(Localization))]
[DateWorkExpAttribute(ErrorMessageResourceType = typeof(Localization), ErrorMessageResourceName = "error_end_date_invalid")]
public Nullable<System.DateTime> EndDate { get; set; }
Is it even possible?