0

I am validating two dates. I am using FoolProf to validate One date in Greater than the other like this...

[DataType(DataType.Date)]
public System.DateTime StartDate{ get; set; }

[DataType(DataType.Date)]
[GreaterThan("StartDate")]
public System.DateTime EndDate { get; set; }

The Problem I found is that it is validating other way round.

When I set a StartDate smaller than EndDate, the message it appears it

StartDate can not be greatest than End Date...

And when I set a EndDate bigger than StartDate, no message appears.

What I am missing.?

Thanks

Diego
  • 2,238
  • 4
  • 31
  • 68
  • What are the dates your comparing and in what format. –  Jun 30 '17 at 22:23
  • the format is dd/mm/yyyy, and the dates is startdate="01/06/2017", and enddate es ="01/07/2017"... any other dates have the same problema. Thanks – Diego Jul 03 '17 at 11:11
  • foolproof adds rules to the `Query.validator` which uses dates in the format `MM/dd/yyyy` by default so its internally comparing an end date of 7th January with a start date of 6th January, not 1st July and 1st August as you may think –  Jul 20 '17 at 01:05

0 Answers0