I am using Kendo UI ASP.NET MVC with entity Framework 5.0. I have used datepicker of kendo and set validation at model side and successfully fire all the validation except Range. So I want to set the range of datepicker for -7 and +7 days and also disable other dates except -7 and +7 from today.
My code is:
HTML:
@Html.Kendo().DatePickerFor(model => model.MyDate)
Model:
[Required]
[DataType(DataType.Date)]
[Range(-7,7,ErrorMessage = "Date must be within -7 to +7 days.")]
[Display(Name = "My Date")]
public DateTime? MyDate { get; set; }
I have used above Range validation but not helpful.
Please someone who knows help me solve this problem, thanks in advance.