Use case:
On some of our list windows, we have DateTime interval filter components (which is basically two DateTimePickers side by side).
We use this component to filter a Grid component, which contains a LocalDateTime type column.
examples.:
if only (From) DateTimeField value is present: 1994.10.10 03:00, empty -> list every item which is greater than this value
if only (To) DateTimeField value present: empty, 2022.10.10 04:00 -> list every item which is less than this value
if both value is present: 1994.01.01 00:00, 2222.02.03 01:11 -> list every item which is in this range.
if both value is empty -> no filtering
The problem:
If you leave the time field empty the whole thing won't work, because the component doesn't have value until you fill the TimeField.
I tried to solve this problem this way:
getValue() when query button pressed -> no value is present when only Date is picked.
Look for "setDefaultTime(LocalTime time)" or "setEmptyTimeValue(LocalTime time)" methods -> no luck there, there is no API like that
Listen to value change and fill the time field with a value if the user only modified the date field -> no luck there, the value change event only fires when both fields are filled. (+ it would be a hack solution)
(4. Instead of DateTimePicker I could use separate DatePicker, TimePicker to look like a DateTimePicker and write my own logic to it. This should work, but i haven't tried out it yet.)
Possible solution/suggestion:
Java API for setting a default empty value for the DateTimePicker.TimeField.
Separate getValue() methods for DateTimePicker.DateField, DateTimePicker.DateTimeField example: getDateValue(), getTimeValue()
Use case: On some of our list windows, we have DateTime interval filter components (which is basically two DateTimePickers side by side). We use this component to filter a Grid component, which contains a LocalDateTime type column. examples.: if only (From) DateTimeField value is present: 1994.10.10 03:00, empty -> list every item which is greater than this value if only (To) DateTimeField value present: empty, 2022.10.10 04:00 -> list every item which is less than this value if both value is present: 1994.01.01 00:00, 2222.02.03 01:11 -> list every item which is in this range. if both value is empty -> no filtering
The problem: If you leave the time field empty the whole thing won't work, because the component doesn't have value until you fill the TimeField.
I tried to solve this problem this way:
Possible solution/suggestion: