Is it possible to use [Range] annotation for dates?
[Range]
something like
[Range(typeof(DateTime), DateTime.MinValue.ToString(), DateTime.To
I did this to fix your problem
public class DateAttribute : RangeAttribute { public DateAttribute() : base(typeof(DateTime), DateTime.Now.AddYears(-20).ToShortDateString(), DateTime.Now.AddYears(2).ToShortDateString()) { } }