Bug 38027: (QA follow-up) Fix flatpickr onChange when input is cleared

With the onChange event handler fixed, it's ok to call clear() instead
of setDate('')

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b892af285b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit eb39ce87ca)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Julian Maurice 2024-10-04 16:03:32 +02:00 committed by Fridolin Somers
parent 860eab6754
commit 801d7f0281
1 changed files with 5 additions and 1 deletions

View File

@ -62,7 +62,7 @@
.addClass("clear_date")
.on("click", function(e){
e.preventDefault();
instance.setDate('');
instance.clear();
})
.addClass("fa fa-fw fa-times")
.attr("aria-hidden", true)
@ -75,6 +75,10 @@
});
},
onChange: function( selectedDates, dateText, instance) {
if (selectedDates.length === 0) {
return;
}
var thisInput = instance.input;
let = accepts_time = $(thisInput).data('flatpickr-enable-time');
if ( accepts_time ) {