Skip to content

Commit

Permalink
🐛 Update conference title to reflect
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus Fihlon <[email protected]>
  • Loading branch information
McPringle committed Apr 9, 2024
1 parent 6fd9229 commit aeca9e4
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/main/java/swiss/fihlon/apus/ui/view/ConferenceView.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ public final class ConferenceView extends Div {
private static final Duration TIME_LIMIT_NEXT_SESSION = Duration.ofHours(1);

private final transient ConferenceService conferenceService;
private final H2 title = createTitle();
private final Div roomContainer = new Div();
private final Span legend = new Span();

public ConferenceView(@NotNull final ConferenceService conferenceService,
@NotNull final TaskScheduler taskScheduler) {
this.conferenceService = conferenceService;
setId("conference-view");
add(new H2(getTranslation("conference.heading",
LocalDate.now().getDayOfWeek().getDisplayName(TextStyle.FULL, UI.getCurrent().getLocale()))));
add(title);
add(createLegend());
add(roomContainer);
final ScheduledFuture<?> updateScheduler = taskScheduler.scheduleAtFixedRate(
Expand Down Expand Up @@ -91,6 +91,19 @@ private void updateConferenceSessions() {
roomContainer.add(roomView);
}
updateLegend(roomStylesInUse);
updateTitle();
}

@NotNull
private H2 createTitle() {
return new H2(getTranslation("conference.heading",
LocalDate.now().getDayOfWeek().getDisplayName(TextStyle.FULL, UI.getCurrent().getLocale())));
}

private void updateTitle() {
title.setText(getTranslation("conference.heading",
LocalDate.now().getDayOfWeek().getDisplayName(TextStyle.FULL, UI.getCurrent().getLocale())));

}

@NotNull
Expand Down

0 comments on commit aeca9e4

Please sign in to comment.