Time
<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 TimeExample { [DynamicRange(typeof(TimeSpan), SMaximum = "20:00:00", SMinimum = "10:00:00")] [DataType(DataType.Time)] public TimeSpan Value { get; set; } }
return View(new TimeExample { Value = new TimeSpan(15, 0 ,0) });