/** * Parses the {@link FixedWeekdayInMonth}. * * @param year * the year * @param fwm * the fwm * @return the local date */ protected LocalDate parse(int year, FixedWeekdayInMonth fwm) { final DayOfWeek weekday = xmlUtil.getWeekday(fwm.getWeekday()); final LocalDate date = LocalDate.of(year, xmlUtil.getMonth(fwm.getMonth()), 1); if (Which.LAST == fwm.getWhich()) { return date.with(lastInMonth(weekday)); } return date.with(dayOfWeekInMonth(fwm.getWhich().ordinal() + 1, weekday)); } }