Bugzilla – Attachment 172401 Details for
Bug 38027
Clearing a flatpickr datetime causes errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38027: (QA follow-up) Fix flatpickr onChange when input is cleared
Bug-38027-QA-follow-up-Fix-flatpickr-onChange-when.patch (text/plain), 1.59 KB, created by
Julian Maurice
on 2024-10-04 14:09:54 UTC
(
hide
)
Description:
Bug 38027: (QA follow-up) Fix flatpickr onChange when input is cleared
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2024-10-04 14:09:54 UTC
Size:
1.59 KB
patch
obsolete
>From 23cd0428eebe089c24259da41b853b1ec91a9f86 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 4 Oct 2024 16:03:32 +0200 >Subject: [PATCH] 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> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index 1d6958f8aa..7914932d38 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -74,7 +74,7 @@ > .addClass("clear_date") > .on("click", function(e){ > e.preventDefault(); >- instance.setDate(''); >+ instance.clear(); > }) > .addClass("fa fa-fw fa-times") > .attr("aria-hidden", true) >@@ -113,6 +113,10 @@ > new Maskito( instance.altInput, maskitoOptions ); > }, > onChange: function( selectedDates, dateText, instance) { >+ if (selectedDates.length === 0) { >+ return; >+ } >+ > var thisInput = instance.input; > let accepts_time = $(thisInput).data('flatpickr-enable-time'); > let accepts_time_only = $(thisInput).data('flatpickr-time-only'); >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38027
:
172185
|
172186
|
172400
| 172401