item.appendChild(listcell);
}
private void appendExpirationDateListcell(Listitem item,
final CalendarAvailability calendarAvailability) {
Listcell listcell = new Listcell();
final Datebox datebox = new Datebox();
Datebox dateboxExpirationDate = Util.bind(datebox,
new Util.Getter<Date>() {
@Override
public Date get() {
LocalDate endDate = calendarAvailability
.getEndDate();
if (endDate != null) {
return endDate.toDateTimeAtStartOfDay()
.toDate();
}
return null;
}
}, new Util.Setter<Date>() {
@Override
public void set(Date value) {
try {
LocalDate endDate = getAppropiateEndDate(
calendarAvailability, value);
baseCalendarModel.setEndDate(
calendarAvailability, endDate);
} catch (IllegalArgumentException e) {
throw new WrongValueException(datebox, e
.getMessage());
}
}
});
listcell.appendChild(dateboxExpirationDate);
item.appendChild(listcell);
}