Date intervals
The renderDay() element applies only to date properties whereby the date will be rendered as the day before the value actually held in the domain object. It is ignored for properties of other types.
This behaviour might at first glance appear odd, but the rationale is to support the use case of a sequence of instances that represent adjacent intervals of time.
In such cases there would typically be startDate and endDate properties, eg for all of Q2. Storing this as a half-closed interval — eg [1-Apr-2015, 1-July-2015) — can substantially simplify internal algorithms; the endDate of one interval will correspond to the startDate of the next.
However, from an end-user perspective the requirement may be to render the interval as a fully closed interval; eg the end date should be shown as 30-Jun-2015.
This attribute therefore bridges the gap; it presents the information in a way that makes sense to an end-user, but also stores the domain object in a way that is easy work with internally.
For example:
import lombok.Getter;
import lombok.Setter;
public class Tenancy {
@Getter @Setter
private LocalDate startDate;
@PropertyLayout(
renderDay = RenderDay.AS_DAY_BEFORE
)
@Getter @Setter
private LocalDate endDate;
// ...
}