TimPicker now uses 24h time format

This commit is contained in:
Marco Kühn 2022-01-14 10:14:17 +01:00
parent ce309581ed
commit baeed584ab

View File

@ -45,15 +45,20 @@ public class CreateEventController {
@FXML @FXML
public void initialize() { public void initialize() {
StringConverter<LocalTime> defaultConverter = new LocalTimeStringConverter(FormatStyle.SHORT, Locale.GERMANY);
JFXTimePicker timePickerStart = new JFXTimePicker(); JFXTimePicker timePickerStart = new JFXTimePicker();
timeStart = timePickerStart; timeStart = timePickerStart;
timePickerStart.set24HourView(true); timePickerStart.set24HourView(true);
timePickerStart.setConverter(defaultConverter);
timePickerStart.getStyleClass().add("timePicker"); timePickerStart.getStyleClass().add("timePicker");
mainGrid.add(timePickerStart, 1 , 3); mainGrid.add(timePickerStart, 1 , 3);
JFXTimePicker timePickerEnd = new JFXTimePicker(); JFXTimePicker timePickerEnd = new JFXTimePicker();
timeEnd = timePickerEnd; timeEnd = timePickerEnd;
timePickerEnd.set24HourView(true); timePickerEnd.set24HourView(true);
timePickerEnd.setConverter(defaultConverter);
timePickerEnd.getStyleClass().add("timePicker"); timePickerEnd.getStyleClass().add("timePicker");
mainGrid.add(timePickerEnd, 1 , 4); mainGrid.add(timePickerEnd, 1 , 4);
} }