[
http://opensource.atlassian.com/projects/hibernate/browse/HV-51?page=com....
]
Emmanuel Bernard commented on HV-51:
------------------------------------
Dan, you are assuming that a java.util.Date represent what humans call a date. But
java.util.Date is a specific instant in time.
Frankly Dates are completely broken in Java. I am waiting on the Date and Time JSR to see
if things get fixed.
@Past and @Future should support inclusive and exclusive boundaries
-------------------------------------------------------------------
Key: HV-51
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HV-51
Project: Hibernate Validator
Issue Type: Improvement
Affects Versions: 3.0.0.ga
Reporter: Dan Allen
Attachments: FutureValidator.java, PastValidator.java
Original Estimate: 2 hours
Remaining Estimate: 2 hours
The @Future and @Past annotations do not offer a way to include the current date in the
range, operating under the pretense of an exclusive boundary condition. The current date
is often needed in the range. For instance, a registration date can be today or any time
in the future. You might have recorded an observation today or any time in the past.
My suggestion is to add an attribute named "inclusive" which implies that the
current date is included.
@Future(inclusive = true)
@Past(inclusive = true)
Feel free to use another name for the attribute. The default, of course, is false for
backwards compatibility.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira