Skip to content

Commit

Permalink
Revert "Don't select seasons that haven't started yet"
Browse files Browse the repository at this point in the history
This reverts commit f71ec50.
  • Loading branch information
BlackYps committed Sep 29, 2024
1 parent f71ec50 commit 1e6291f
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@
import org.springframework.stereotype.Component;
import reactor.core.publisher.Mono;

import java.time.OffsetDateTime;
import java.time.format.FormatStyle;
import java.util.List;
import java.util.Optional;


@Slf4j
Expand Down Expand Up @@ -68,13 +66,7 @@ protected void onInitialize() {

leagueSeasons.map(FXCollections::observableList).when(showing).subscribe(seasons -> {
seasonPicker.getItems().setAll(seasons);
Optional<LeagueSeason> currentSeason = seasons.stream()
.filter(season -> season.startDate().isBefore(OffsetDateTime.now()))
.findFirst();
currentSeason.ifPresentOrElse(
season -> seasonPicker.getSelectionModel().select(season),
() -> seasonPicker.getSelectionModel().selectFirst()
);
seasonPicker.getSelectionModel().selectFirst();
});

seasonDateLabel.textProperty().bind(leagueSeason.map(seasonBean -> {
Expand Down

0 comments on commit 1e6291f

Please sign in to comment.