if (date == null) {
if (version.equals(getBaseCalendar().getLastCalendarData())) {
return;
} else {
throw new ValidationException(_("This date cannot be empty"));
}
}
LocalDate newExpiringDate = LocalDate.fromDateFields(date);
if ((index < getBaseCalendar().getCalendarDataVersions().size() - 1)) {
LocalDate nextExpiringDate = getBaseCalendar()
.getCalendarDataVersions().get(index + 1).getExpiringDate();
if ((nextExpiringDate == null)
|| (newExpiringDate.compareTo(nextExpiringDate) < 0)) {
return;
}
}
throw new ValidationException(
_("Date cannot include the entire next work week"));
}