[Koha-bugs] [Bug 28942] Use Flatpickr on acquisitions pages

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Oct 4 15:37:34 CEST 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28942

Jonathan Druart <jonathan.druart+koha at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jonathan.druart+koha at gmail.
                   |                            |com

--- Comment #5 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
Question (not related only to this patch, but other flatpickr ones as well):
Why don't you set the flatpickrto class when needed?

For instance:

+            var billingdatefrom = $("#billingdatefrom").flatpickr({
+                onClose: function( selectedDates, dateText, instance) {
+                    validate_date( selectedDates, instance );
+                    billingdateto.set('minDate', selectedDates[0]);
+                }
+            });
+            var billingdateto = $("#billingdateto").flatpickr({
+                onClose: function( selectedDates, dateText, instance) {
+                    validate_date( selectedDates, instance );
+                },
+            });

You need billingdatefrom, but you could use .flatpickrto for #billintdateto.

Also I think we could improve it a bit more, .flatpickrfrom could have a data
containing the name of its "to".

We could only have:

  <input type="text" size="10" id="from" name="date_from" value=""
class="flatpickrfrom" data-date_to="to" />

  <input type="text" size="10" id="to" name="date_to" value=""
class="flatpickrto" />

And a couple of line in calendar.inc to link them.

I won't ofc block this patch series for that, but it would be great to have a
follow-up bug on top to clean it.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list