public void setDateTimePermissive(LocalDateTime optionalDateTime) {
        if (optionalDateTime == null) {
            datePicker.setDate(null);
            timePicker.setTime(null);
            return;
        }
        datePicker.setDate(optionalDateTime.toLocalDate());
        timePicker.setTime(optionalDateTime.toLocalTime());
    }
public void setDateTimePermissive ( LocalDateTime optionalDateTime ) { if ( optionalDateTime == null ) { datePicker . setDate ( null ) ; timePicker . setTime ( null ) ; return ; } datePicker . setDate ( optionalDateTime . toLocalDate ( ) ) ; timePicker . setTime ( optionalDateTime . toLocalTime ( ) ) ; }
setDateTimePermissive, This uses the supplied LocalDateTime to set the value of the
DatePicker and the TimePicker. Values that are set from this function are processed through
the same validation procedures as values that are typed by the user.

Note: The functions setDateTimePermissive(LocalDateTime value) and
setDateTimeStrict(LocalDateTime value) are identical (Only the "get" version of these
functions is different), but both of these function names are included for API consistency
and for compatibility with JavaBeans data binding functionality.

More specifically:

Date validation and time validation are performed separately. Date validation is handled by
the DatePicker, and time validation is handled by the TimePicker. The veto policy and
"allowEmptyValues" settings are used to determine whether or not a particular value is
"allowed".

Allowed values will be set in the text field, and also committed to the "last valid value" of
the applicable component. Disallowed values will be set in the text field (with a disallowed
indicator font), but will not be committed to the "last valid value" of the applicable
component.

It is possible for a particular LocalDateTime value to be allowed by one component (and
therefore committed to that component), but not allowed by the other component.

A value can be checked against any current veto policies, and against the allowEmptyTimes
settings, by calling isDateTimeAllowed(). This can be used to determine (in advance), if a
particular value would be allowed by both components.

Note: If empty values are allowed by both components, and there is no veto policy on either
component, then all possible values will (always) be allowed. These are the default settings
of the components.

For additional details about the automatic date and time validation, see:
DatePicker.setDate() and TimePicker.setTime().