Skip to content

Instantly share code, notes, and snippets.

@JustinMason
Created March 20, 2013 15:03
Show Gist options
  • Save JustinMason/5205378 to your computer and use it in GitHub Desktop.
Save JustinMason/5205378 to your computer and use it in GitHub Desktop.
public class HomePageViewModel
{
[Display(Order=0, Name="Full Name")]
[Required(ErrorMessage="Full Name is Required")]
public string Name { get; set; }
[Display(Order=1, Name="Birthday") ]
[DateComparer(MaxDateAddDaysFromNow=0, MinDateSelector="PropertyDate")]
//Must be less than Now and Greater than the sibling property PropertyDate
public DateTime BirthDate { get; set; }
[HiddenInput(DisplayValue=false)]
public string PropertyDate {
get { return new DateTime(2013, 1, 1).ToString("G"); }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment