DateTimePicker hours validation

Hi All, I am using vaadin 24.4.3 and I have implemented a DateTimePicker:

DateTimePicker resolutionDate = new DateTimePicker();
resolutionDate.setLabel(“Resolution Date”);
resolutionDate.setSizeFull();
resolutionDate.setId(“resolutionDate”);
resolutionDate.setDatePickerI18n(datepickeri18n);

The field is optional. When user fills the date and does not select any time, the component does not display any message indicating that the date is incomplete (Or I have not been able to get it). Can I validate that case? Thanks. Regards

DateTimePicker is missing a lot of sensible behavior.
In my case I got around it by replacing it with a CustomField around a DatePicker and a TimePicker.
That way I could program exactly the behavior I wanted:

  • Nulling one part nulls the other
  • Lambdas for getting defaults (ie, when setting time we can look up a sensible date)
  • If one part is set and the other is not, set that part to invalid

I seem to recall that I had issues displaying it properly in a Vaadin FormLayout, but I don’t use that anymore, so can’t be certain.