Here's a simple source, stating that this date must be in the past using Bean Validation :
@Past
private Date transactionDate;
Is there any BV annotation for validating that the date must be today or previous day?
Or perhaps I need to extend the constraint and provide my own?
To get past and today you can use
@PastOrPresent
Just found out the answer for this, @Past means today or any day before today.
So, using @Past suits my need without having to provide my own constraint.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With