I have a model class given below in MVC. I am trying to set MinDate and MaxDate for the DatePicker
public class YourModel { public DateTime Deadline { get; set; } public DateTime MinDate { get; set; } public DateTime MaxDate { get; set; } }
@(Html.Kendo().DatePickerFor(x => x.Deadline) .Name("datepicker") // Set the name attribute .Format("MM/dd/yyyy") .Min(DateTime.Today) // Set the minimum date .Max(DateTime.Today.AddMonths(3)) // Set the maximum date (in this example, 3 months from today) .HtmlAttributes(new { id = "datepicker" }) // Set the ID attribute )