Month
<div class="form-group"> <label asp-for="Value" class="col-xs-12 control-label"></label> <div class="col-xs-12"> <input asp-for="Value" class="form-control" /> <span asp-validation-for="Value" class="text-danger"></span> </div> </div>
public class MonthExample { [DynamicRange(typeof(Month), SMinimum = "2016-1", SMaximum = "2016-12")] public Month Value { get; set; } }
return View(new DatetimeExample { Value = new Month(2016, 6) });