Bugfix Calendarreload

master
Markus Kreth 7 years ago
parent aca5e88ef6
commit 2a57e05b88
  1. 3
      src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/MainView.java
  2. 1
      src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/CalendarComponent.java
  3. 3
      src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/ZonedDateTimeConverter.java

@ -74,8 +74,6 @@ public class MainView extends VerticalLayout implements NamedView {
openPersonViewForEvent(current); openPersonViewForEvent(current);
if (current != null) { if (current != null) {
calendar.setToday(current.getStart()); calendar.setToday(current.getStart());
} else {
reloadEvents();
} }
head.updateLoggedinPerson(); head.updateLoggedinPerson();
} else { } else {
@ -83,6 +81,7 @@ public class MainView extends VerticalLayout implements NamedView {
detailClosed(); detailClosed();
head.updateLoggedinPerson(); head.updateLoggedinPerson();
} }
reloadEvents();
} }
} }

@ -81,6 +81,7 @@ public class CalendarComponent extends CustomComponent {
@Override @Override
public void setItems(Collection<ClubEvent> items) { public void setItems(Collection<ClubEvent> items) {
super.itemList.clear();
super.setItems(items); super.setItems(items);
fireItemSetChanged(); fireItemSetChanged();
} }

@ -15,6 +15,9 @@ public class ZonedDateTimeConverter implements Converter<LocalDate, ZonedDateTim
@Override @Override
public Result<ZonedDateTime> convertToModel(LocalDate value, ValueContext context) { public Result<ZonedDateTime> convertToModel(LocalDate value, ValueContext context) {
if (value == null) {
return Result.ok(null);
}
return Result.ok(ZonedDateTime.of(value, LocalTime.MIDNIGHT, ZoneId.systemDefault())); return Result.ok(ZonedDateTime.of(value, LocalTime.MIDNIGHT, ZoneId.systemDefault()));
} }

Loading…
Cancel
Save