HistoricDate cd = calendrical.get(HistoricDate.rule());
return cd != null ? cd.getYear() : null;
}
@Override
protected void merge(CalendricalMerger merger) {
MonthOfYear moy = merger.getValue(chrono.monthOfYearRule());
Integer domVal = merger.getValue(chrono.dayOfMonthRule());
if (moy != null && domVal != null) {
int year = merger.getValue(this);
HistoricDate date;
if (merger.getContext().isStrict()) {
date = HistoricDate.of(year, moy, domVal);
} else {
// TODO: date in cutover
date = HistoricDate.of(year, MonthOfYear.JANUARY, 1)
.plusMonths(moy.getValue() - 1).plusMonths(-1).plusDays(domVal).plusDays(-1);
}
merger.storeMerged(LocalDate.rule(), date.toLocalDate());
merger.removeProcessed(this);
merger.removeProcessed(chrono.monthOfYearRule());
merger.removeProcessed(chrono.dayOfMonthRule());