From 90cb7e26111971d5a05bfe9ca58dea0105622abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Grabowski?= Date: Thu, 19 Jan 2023 09:37:40 +0100 Subject: [PATCH] after cr --- .../public/js/scripts/core/date.time.picker.js | 11 ++++------- .../component/inputs/input_date_time_picker.html.twig | 5 ++++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/bundle/Resources/public/js/scripts/core/date.time.picker.js b/src/bundle/Resources/public/js/scripts/core/date.time.picker.js index f26058a961..fb10555706 100644 --- a/src/bundle/Resources/public/js/scripts/core/date.time.picker.js +++ b/src/bundle/Resources/public/js/scripts/core/date.time.picker.js @@ -13,7 +13,7 @@ this.fieldWrapper = this.container.querySelector('.ibexa-date-time-picker'); this.inputField = this.fieldWrapper.querySelector('.ibexa-date-time-picker__input'); this.actionsWrapper = this.fieldWrapper.querySelector('.ibexa-input-text-wrapper__actions'); - this.calendarButton = this.actionsWrapper.querySelector('.ibexa-input-text-wrapper__action-btn--calendar'); + this.calendarBtn = this.actionsWrapper.querySelector('.ibexa-input-text-wrapper__action-btn--calendar'); this.clearBtn = this.fieldWrapper.querySelector('.ibexa-input-text-wrapper__action-btn--clear'); this.customOnChange = config.onChange; @@ -99,18 +99,15 @@ this.flatpickrInstance = flatpickr(this.inputField, this.flatpickrConfig); this.inputField.addEventListener('input', this.onInput, false); - this.calendarButton.addEventListener( + this.flatpickrInstance.minuteElement.addEventListener('keyup', this.onKeyUp.bind(this, true), false); + this.flatpickrInstance.hourElement.addEventListener('keyup', this.onKeyUp.bind(this, false), false); + this.calendarBtn.addEventListener( 'click', () => { this.flatpickrInstance.open(); }, false, ); - - if (this.flatpickrInstance.config.enableTime) { - this.flatpickrInstance.minuteElement.addEventListener('keyup', this.onKeyUp.bind(this, true), false); - this.flatpickrInstance.hourElement.addEventListener('keyup', this.onKeyUp.bind(this, false), false); - } } } diff --git a/src/bundle/Resources/views/themes/admin/ui/component/inputs/input_date_time_picker.html.twig b/src/bundle/Resources/views/themes/admin/ui/component/inputs/input_date_time_picker.html.twig index 20c3f71074..9f711adfd1 100644 --- a/src/bundle/Resources/views/themes/admin/ui/component/inputs/input_date_time_picker.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/component/inputs/input_date_time_picker.html.twig @@ -27,7 +27,10 @@ {% endblock %} {% block actions %} {{ parent() }} -