Date validation errors with @FutureOrPresent and @PastOrPresent annotations
based on forum's question
Environment
- Platform version: CUBA 7.2.15
- Tomcat 9
- Database: HSQLDB
- OS: Ubuntu 20.04 LTS
Preconditions: install local tomcat server
Shared steps:
TC 1:
- Open http://localhost:8080/app/ -> login as admin
- Open Parts browser -> Create new one -> Set present date to date fields with 'Future' prefixes -> Save
AR: validation error with date types: Date, OffsetDateTime, LocalDateTime
ER: entity had been successfully created
TC 2:
- Change system time to next day, 00:xx
- Open http://localhost:8080/app
- Open Parts browser -> Create new one -> Set present date to date fields with 'Past' prefixes -> Save
AR: validation error with all date types
ER: entity had been successfully created
@owlet1997 could you please check it in Jmix and create an issue there too?
Seems that the problem is present in Cuba and Jmix since commit.
When validators created during context initialisation the ClockProvider provides clock with date fixed on application startup date. Since Hibernate DefaultClockProvider works well, I propose implementing ClockProvider the same way