Search in sources :

Example 1 with LocalTimeStringConverter

use of javafx.util.converter.LocalTimeStringConverter in project JFoenix by jfoenixadmin.

the class JFXTimePickerContent method updateValue.

void updateValue() {
    if (is24HourView) {
        LocalTimeStringConverter localTimeStringConverter = new LocalTimeStringConverter(FormatStyle.SHORT, Locale.GERMAN);
        timePicker.setValue(localTimeStringConverter.fromString(selectedHourLabel.getText() + ":" + selectedMinLabel.getText()));
    } else {
        timePicker.setValue(LocalTime.parse(selectedHourLabel.getText() + ":" + selectedMinLabel.getText() + " " + period.get(), DateTimeFormatter.ofPattern("h:mm a").withLocale(Locale.ENGLISH)));
    }
}
Also used : LocalTimeStringConverter(javafx.util.converter.LocalTimeStringConverter)

Aggregations

LocalTimeStringConverter (javafx.util.converter.LocalTimeStringConverter)1