https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28942 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #5 from Jonathan Druart <jonathan.druart+koha@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.