View | Details | Raw Unified | Return to bug 31262
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/curbside_pickups.tt (+8 lines)
Lines 547-552 Link Here
547
                $('#input-patron-cardnumber').focus();
547
                $('#input-patron-cardnumber').focus();
548
            });
548
            });
549
549
550
            const pickup_date = document.querySelector("#pickup_date");
551
            if ( pickup_date ) {
552
                const fp = pickup_date._flatpickr;
553
                fp.set('disable', [function(date) {
554
                    return !slots_per_day.hasOwnProperty(date.getDay());
555
                }]);
556
            }
557
550
            $("#pickup_date").on('change', function() {
558
            $("#pickup_date").on('change', function() {
551
559
552
                $('#pickup-times').empty();
560
                $('#pickup-times').empty();
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-curbside-pickups.tt (-3 / +5 lines)
Lines 352-359 Link Here
352
                }
352
                }
353
            });
353
            });
354
354
355
            const pickupDate = document.getElementById("pickup-date");
355
            const pickupDate_fp = document.getElementById("pickup-date")._flatpickr;
356
            pickupDate._flatpickr.config.onClose.push(function( selectedDates, dateStr, instance ){
356
            pickupDate_fp.set('disable', [function(date) {
357
                return !slots_per_day.hasOwnProperty(date.getDay());
358
            }]);
359
            pickupDate_fp.config.onClose.push(function( selectedDates, dateStr, instance ){
357
                /* Here we add an onClose event to the existing flatpickr instance */
360
                /* Here we add an onClose event to the existing flatpickr instance */
358
                /* It fires after the user has selected a date from the calendar popup */
361
                /* It fires after the user has selected a date from the calendar popup */
359
                $('#pickup-times').html("<label>" + _("Select a time") + ":</label><div id=\"pickup-time-slots\"></div>");
362
                $('#pickup-times').html("<label>" + _("Select a time") + ":</label><div id=\"pickup-time-slots\"></div>");
360
- 

Return to bug 31262