Skip to content

Commit

Permalink
Merge pull request #216 from dlsc-software-consulting-gmbh/fix-date-r…
Browse files Browse the repository at this point in the history
…ange-view-mode-limitations

Enforce DATE_RANGE mode in DateRangeView selection model.
  • Loading branch information
dlemmermann authored Dec 13, 2024
2 parents 0f5c441 + 35889b3 commit ed74cf7
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public DateRangeView() {

selectionModel = new SelectionModel();
selectionModel.setSelectionMode(SelectionModel.SelectionMode.DATE_RANGE);
selectionModel.selectionModeProperty().addListener(it -> {
if (selectionModel.getSelectionMode() != SelectionModel.SelectionMode.DATE_RANGE) {
throw new UnsupportedOperationException("SINGLE_DATE and MULTIPLE_DATES modes are not supported");
}
});

startCalendarView = getStartCalendarView();
startCalendarView.setSelectionModel(selectionModel);
Expand Down

0 comments on commit ed74cf7

Please sign in to comment.