Future date validation

Hi,
I’m trying to doing date validation for future date validation.My code is it allow for only past and present date only.i’m trying to do not allow for future date.
Give any example for this.

thanks.

Hi
this is not something exclusive to CUBA. You just need to use JSR 303 validation, placing a validation attribute on top of the Date field(s) you want to check.

For more information see for example this article:

This is a list of attributes supported by the Bean Validation spec ver 1.1:
https://docs.oracle.com/javaee/6/tutorial/doc/gircz.html

Unfortunately @PastOrPresent annotation is part of ver. 2.0, that’s not used in CUBA at the moment. It’s trivial to implement though, and you’ll find plenty of examples of working code only googling it.

P.