2

I have a field :

private Date effectiveDate;

I intend to use jsr303 validation and need to validate that the date is today or greater than today.

I was unable to find an annotation for this.

I came across @Past and @Future but I need something like @TodayOrFuture

Is there any such existing annotation or does this require a custom annotation?

All inputs appreciated.

Thanks

souser
  • 796
  • 2
  • 8
  • 25
  • Perilous territory. Is the user's understanding of 'today' always the same as the computer running the code? (Which is why providing a canned annotation wouldn't work so well, there is no universally accepted definition for a java.util.Date representing "today".) – Affe Sep 03 '13 at 22:03
  • it's not an official implementation, but you can check this out: http://waxolunist.github.io/validationconstraints/ – Abel Pastur Sep 03 '13 at 22:07
  • Thanks Affe. You have a valid point. I will look at the code. Thanks for the links Abel. – souser Sep 10 '13 at 20:34

0 Answers0