|
In the context of HV-820 we discussed adding a "resolution" parameter to the constraints: @Past(resolution=Resolution.DAY). The time zone may be injected into the validator via CDI (e.g. via a producer method which returns the time zone from the given user), possibly with falling back to the default (host) time zone if no time zone can be obtained that way.
We definitely can experiment in HV; obviously we can't change the annotations, so we either could add custom constraints (@PastWithResolution) or allow to specify the resolution via another annotation (e.g. @ValidatedDateResolution(Resolution.DAY)) which would then apply to all time constraints of the annotated element, though (in case there are more than one).
|