diff --git a/domino-ui/src/main/java/org/dominokit/domino/ui/forms/TimeBox.java b/domino-ui/src/main/java/org/dominokit/domino/ui/forms/TimeBox.java index 7ab4d9eb9..72f7f535c 100644 --- a/domino-ui/src/main/java/org/dominokit/domino/ui/forms/TimeBox.java +++ b/domino-ui/src/main/java/org/dominokit/domino/ui/forms/TimeBox.java @@ -501,7 +501,6 @@ public void onTimeSelectionChanged(Date date) { clearInvalid(); withValue(date); } - this.popover.close(); } } diff --git a/domino-ui/src/main/java/org/dominokit/domino/ui/timepicker/TimePicker.java b/domino-ui/src/main/java/org/dominokit/domino/ui/timepicker/TimePicker.java index ac4a315ec..b72e84873 100644 --- a/domino-ui/src/main/java/org/dominokit/domino/ui/timepicker/TimePicker.java +++ b/domino-ui/src/main/java/org/dominokit/domino/ui/timepicker/TimePicker.java @@ -113,12 +113,17 @@ public TimePicker(Date date, DateTimeFormatInfo dateTimeFormatInfo) { this.date = updatedTime; onTimeViewUpdate(updatedTime); triggerChangeListeners(oldTime, this.date); - timeSelectionListeners.forEach(listener -> listener.onDaySelected(oldTime, this.date)); + onTimeSelectionChanged(this.date); + timeSelectionListeners.forEach(listener -> listener.onTimeSelected(oldTime, this.date)); }); onTimeViewUpdate(this.date); } + private void onTimeSelectionChanged(Date date) { + new ArrayList<>(viewListeners).forEach(listener -> listener.onTimeSelectionChanged(date)); + } + /** * Creates a new TimePicker instance with the specified date. * @@ -214,10 +219,15 @@ public DateTimeFormatInfo getDateTimeFormatInfo() { */ public TimePicker setDateTimeFormatInfo(DateTimeFormatInfo dateTimeFormatInfo) { this.dateTimeFormatInfo = dateTimeFormatInfo; - onTimeViewUpdate(this.date); + onDateTimeFormatChanged(); return this; } + private void onDateTimeFormatChanged() { + new ArrayList<>(viewListeners) + .forEach(listener -> listener.onDateTimeFormatInfoChanged(getDateTimeFormatInfo())); + } + /** * Binds a TimePickerViewListener to this TimePicker instance. * diff --git a/domino-ui/src/main/java/org/dominokit/domino/ui/timepicker/TimeSelectionListener.java b/domino-ui/src/main/java/org/dominokit/domino/ui/timepicker/TimeSelectionListener.java index b3d23e287..ff59a6fb1 100644 --- a/domino-ui/src/main/java/org/dominokit/domino/ui/timepicker/TimeSelectionListener.java +++ b/domino-ui/src/main/java/org/dominokit/domino/ui/timepicker/TimeSelectionListener.java @@ -26,5 +26,5 @@ public interface TimeSelectionListener { * @param oldDate The previously selected date. * @param newDate The newly selected date. */ - void onDaySelected(Date oldDate, Date newDate); + void onTimeSelected(Date oldDate, Date newDate); }