FXML on datepicker
@FXML private DatePicker dp_detay_cal;
pojo.setFirstDate(dp_detay_cal.getValue());
error: localdate cannot be converted date
how to converted
FXML on datepicker
@FXML private DatePicker dp_detay_cal;
pojo.setFirstDate(dp_detay_cal.getValue());
error: localdate cannot be converted date
how to converted
Copyright © 2021 Jogjafile Inc.
The preferred solution would be to use a
LocalDate
as the type for yourfirstDate
property in your pojo class.A
java.util.Date
includes more information that aLocalDate
; it includes a time (of day) and a time zone. So you need to include some values for those before you can convert to aDate
.If, for some reason, you can't change the pojo class, try