* @param savingsBefore the active savings, not null
* @return the transition, never null
*/
ZoneOffsetTransition toTransition(ZoneOffset standardOffset, Period savingsBefore) {
ZoneOffset offsetAfter = standardOffset.plus(savingAmount);
LocalDate date;
if (dayOfMonth == -1) {
Year yr = Year.isoYear(year);
date = LocalDate.date(yr, month, month.getLastDayOfMonth(yr));
if (dayOfWeek != null) {
date = date.with(DateAdjusters.previousOrCurrent(dayOfWeek));
}
} else {
date = LocalDate.date(year, month, dayOfMonth);
if (dayOfWeek != null) {
date = date.with(DateAdjusters.nextOrCurrent(dayOfWeek));
}
}
date = deduplicate(date);
LocalDateTime ldt = deduplicate(LocalDateTime.dateTime(date, time));
ZoneOffset wallOffset = deduplicate(standardOffset.plus(savingsBefore));