Java Code Examples for javafx.scene.control.DatePicker#getValue()

The following examples show how to use javafx.scene.control.DatePicker#getValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RFXDatePicker.java    From marathonv5 with Apache License 2.0 7 votes vote down vote up
@Override
public void focusGained(RFXComponent prev) {
    DatePicker datePicker = (DatePicker) node;
    LocalDate value = datePicker.getValue();
    if (value == null && datePicker.isEditable()) {
        prevDate = datePicker.getEditor().getText();
    } else {
        prevDate = getDatePickerText(datePicker, value);
    }
}
 
Example 2
Source File: RFXDatePicker.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@Override
public void focusLost(RFXComponent next) {
    DatePicker datePicker = (DatePicker) node;
    LocalDate value = datePicker.getValue();
    String currentDate;
    if (value == null && datePicker.isEditable()) {
        currentDate = datePicker.getEditor().getText();
    } else {
        currentDate = getDatePickerText(datePicker, value);
    }
    if (!currentDate.equals(prevDate))
        recorder.recordSelect(this, currentDate);
}
 
Example 3
Source File: GetNewSecret.java    From strongbox with Apache License 2.0 4 votes vote down vote up
private Optional<ZonedDateTime> getDate(DatePicker datePicker) {
    return datePicker.getValue() != null
            ? Optional.of(ZonedDateTime.of(datePicker.getValue().atTime(0, 0), ZoneId.of("UTC")))
            : Optional.empty();
}