We have an existing hotel management system. I was asked to add a date validation in the "Create Accommodation" function in the system. The dialog looks like this:
The "End Date" is already validated as shown in the code below. The @Future annotation in Hibernate ensures that the date is in the future.
@NotNull
@Future
@DateTimeFormat(pattern = "dd/MM/yyyy")
@Temporal(TemporalType.DATE)
private Date endDate;
EDIT
I was asked to add a validation to the "Start date". Only the present or a future date is allowed. I tried to use a @Present annotation, but I guess there is no such thing. Unfortunately, @Future does not accept today's date. I am new to this kind of thing. So I hope some