} else if (index == 2) {
final LocalDate selectedDay = new LocalDate(startAllocationDate.getValue());
if (isAppropriative()) {
LimitingResourceQueueElement beingEdited = getBeingEditedElement();
if (selectedDay.compareTo(new LocalDate(beingEdited.getEarliestStartDateBecauseOfGantt())) < 0) {
throw new WrongValueException(startAllocationDate, _("Day is not valid"));
}
return new DateAndHour(selectedDay, 0);
} else {
DateAndHour allocationTime = getValidDayInGap(selectedDay, getSelectedGap());
if (allocationTime == null) {
throw new WrongValueException(startAllocationDate, _("Day is not valid"));
}
return allocationTime;
}
}
return null;