开发者

Bean Validation for @Past or today?

开发者 https://www.devze.com 2023-02-18 21:15 出处:网络
Here\'s a simple source, stating that this date must be in the past using Bean开发者_StackOverflow中文版 Validation :

Here's a simple source, stating that this date must be in the past using Bean开发者_StackOverflow中文版 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?


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.


To get past and today you can use

@PastOrPresent
0

精彩评论

暂无评论...
验证码 换一张
取 消