public LocalDateTime getDateTimePermissive ( ) { LocalDate dateValue = datePicker . getDate ( ) ; LocalTime timeValue = timePicker . getTime ( ) ; timeValue = ( timeValue == null ) ? LocalTime . MIDNIGHT : timeValue ; if ( dateValue == null ) { return null ; } return LocalDateTime . of ( dateValue , timeValue ) ; }
getDateTimePermissive This attempts to retrieve the date from the date picker and the time from the time picker and return a single LocalDateTime value . If a date is present but the time picker contains null then the time portion of the returned value will be set to LocalTime . MIDNIGHT .