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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt (-1 / +4 lines)
Lines 63-69 Link Here
63
    [% INCLUDE modals/cancel_booking.inc %]
63
    [% INCLUDE modals/cancel_booking.inc %]
64
64
65
    [% MACRO jsinclude BLOCK %]
65
    [% MACRO jsinclude BLOCK %]
66
    [% Asset.js("lib/dayjs/dayjs.min.js") | $raw %]
67
    [% Asset.js("lib/vis-timeline/vis-timeline-graph2d.min.js") | $raw %]
66
    [% Asset.js("lib/vis-timeline/vis-timeline-graph2d.min.js") | $raw %]
68
    [% INCLUDE 'datatables.inc' %]
67
    [% INCLUDE 'datatables.inc' %]
69
    [% INCLUDE 'columns_settings.inc' %]
68
    [% INCLUDE 'columns_settings.inc' %]
Lines 71-76 Link Here
71
    [% INCLUDE 'select2.inc' %]
70
    [% INCLUDE 'select2.inc' %]
72
    [% INCLUDE 'js-patron-format.inc' %]
71
    [% INCLUDE 'js-patron-format.inc' %]
73
    [% INCLUDE 'js-date-format.inc' %]
72
    [% INCLUDE 'js-date-format.inc' %]
73
    [% Asset.js("lib/dayjs/plugin/isSameOrAfter.js") | $raw %]
74
    [% Asset.js("lib/dayjs/plugin/isSameOrBefore.js") | $raw %]
75
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
76
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
74
    [% Asset.js("js/modals/place_booking.js") | $raw %]
77
    [% Asset.js("js/modals/place_booking.js") | $raw %]
75
    [% Asset.js("js/cancel_booking_modal.js") | $raw %]
78
    [% Asset.js("js/cancel_booking_modal.js") | $raw %]
76
<script>
79
<script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt (+5 lines)
Lines 86-91 Link Here
86
86
87
[% MACRO jsinclude BLOCK %]
87
[% MACRO jsinclude BLOCK %]
88
    [% INCLUDE 'catalog-strings.inc' %]
88
    [% INCLUDE 'catalog-strings.inc' %]
89
    [% Asset.js("lib/dayjs/dayjs.min.js") | $raw %]
90
    [% Asset.js("lib/dayjs/plugin/isSameOrAfter.js") | $raw %]
91
    [% Asset.js("lib/dayjs/plugin/isSameOrBefore.js") | $raw %]
92
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
93
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
89
    [% INCLUDE 'calendar.inc' %]
94
    [% INCLUDE 'calendar.inc' %]
90
    [% INCLUDE 'select2.inc' %]
95
    [% INCLUDE 'select2.inc' %]
91
    [% Asset.js("js/catalog.js") | $raw %]
96
    [% Asset.js("js/catalog.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt (+5 lines)
Lines 212-217 Link Here
212
212
213
[% MACRO jsinclude BLOCK %]
213
[% MACRO jsinclude BLOCK %]
214
    [% INCLUDE 'catalog-strings.inc' %]
214
    [% INCLUDE 'catalog-strings.inc' %]
215
    [% Asset.js("lib/dayjs/dayjs.min.js") | $raw %]
216
    [% Asset.js("lib/dayjs/plugin/isSameOrAfter.js") | $raw %]
217
    [% Asset.js("lib/dayjs/plugin/isSameOrBefore.js") | $raw %]
218
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
219
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
215
    [% INCLUDE 'calendar.inc' %]
220
    [% INCLUDE 'calendar.inc' %]
216
    [% INCLUDE 'select2.inc' %]
221
    [% INCLUDE 'select2.inc' %]
217
    [% Asset.js("js/catalog.js") | $raw %]
222
    [% Asset.js("js/catalog.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +5 lines)
Lines 1125-1132 Link Here
1125
    [% END %]
1125
    [% END %]
1126
1126
1127
[% MACRO jsinclude BLOCK %]
1127
[% MACRO jsinclude BLOCK %]
1128
    [% INCLUDE 'catalog-strings.inc' %]
1129
    [% INCLUDE 'calendar.inc' %]
1128
    [% INCLUDE 'calendar.inc' %]
1129
    [% INCLUDE 'catalog-strings.inc' %]
1130
    [% INCLUDE 'select2.inc' %]
1130
    [% INCLUDE 'select2.inc' %]
1131
    [% INCLUDE 'js-date-format.inc' %]
1131
    [% INCLUDE 'js-date-format.inc' %]
1132
    [% Asset.js("js/catalog.js") | $raw %]
1132
    [% Asset.js("js/catalog.js") | $raw %]
Lines 1554-1559 Link Here
1554
    [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1554
    [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1555
    [% INCLUDE 'columns_settings.inc' %]
1555
    [% INCLUDE 'columns_settings.inc' %]
1556
    [% INCLUDE 'js-date-format.inc' %]
1556
    [% INCLUDE 'js-date-format.inc' %]
1557
    [% Asset.js("lib/dayjs/plugin/isSameOrAfter.js") | $raw %]
1558
    [% Asset.js("lib/dayjs/plugin/isSameOrBefore.js") | $raw %]
1559
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
1560
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
1557
    [% INCLUDE 'js-patron-format.inc' %]
1561
    [% INCLUDE 'js-patron-format.inc' %]
1558
    [% INCLUDE 'js-biblio-format.inc' %]
1562
    [% INCLUDE 'js-biblio-format.inc' %]
1559
    [% Asset.js("js/browser.js") | $raw %]
1563
    [% Asset.js("js/browser.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt (+5 lines)
Lines 139-144 Link Here
139
139
140
[% MACRO jsinclude BLOCK %]
140
[% MACRO jsinclude BLOCK %]
141
    [% INCLUDE 'catalog-strings.inc' %]
141
    [% INCLUDE 'catalog-strings.inc' %]
142
    [% Asset.js("lib/dayjs/dayjs.min.js") | $raw %]
143
    [% Asset.js("lib/dayjs/plugin/isSameOrAfter.js") | $raw %]
144
    [% Asset.js("lib/dayjs/plugin/isSameOrBefore.js") | $raw %]
145
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
146
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
142
    [% INCLUDE 'calendar.inc' %]
147
    [% INCLUDE 'calendar.inc' %]
143
    [% INCLUDE 'select2.inc' %]
148
    [% INCLUDE 'select2.inc' %]
144
    [% Asset.js("js/catalog.js") | $raw %]
149
    [% Asset.js("js/catalog.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt (+5 lines)
Lines 100-105 Link Here
100
100
101
[% MACRO jsinclude BLOCK %]
101
[% MACRO jsinclude BLOCK %]
102
    [% INCLUDE 'catalog-strings.inc' %]
102
    [% INCLUDE 'catalog-strings.inc' %]
103
    [% Asset.js("lib/dayjs/dayjs.min.js") | $raw %]
104
    [% Asset.js("lib/dayjs/plugin/isSameOrAfter.js") | $raw %]
105
    [% Asset.js("lib/dayjs/plugin/isSameOrBefore.js") | $raw %]
106
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
107
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
103
    [% INCLUDE 'calendar.inc' %]
108
    [% INCLUDE 'calendar.inc' %]
104
    [% INCLUDE 'select2.inc' %]
109
    [% INCLUDE 'select2.inc' %]
105
    [% Asset.js("js/catalog.js") | $raw %]
110
    [% Asset.js("js/catalog.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (+4 lines)
Lines 518-523 Link Here
518
    [% INCLUDE 'catalog-strings.inc' %]
518
    [% INCLUDE 'catalog-strings.inc' %]
519
    [% INCLUDE 'modals/checkout_renewals.inc' %]
519
    [% INCLUDE 'modals/checkout_renewals.inc' %]
520
    [% INCLUDE 'js-date-format.inc' %]
520
    [% INCLUDE 'js-date-format.inc' %]
521
    [% Asset.js("lib/dayjs/plugin/isSameOrAfter.js") | $raw %]
522
    [% Asset.js("lib/dayjs/plugin/isSameOrBefore.js") | $raw %]
523
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
524
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
521
    [% INCLUDE 'js-patron-format.inc' %]
525
    [% INCLUDE 'js-patron-format.inc' %]
522
    [% INCLUDE 'calendar.inc' %]
526
    [% INCLUDE 'calendar.inc' %]
523
    [% INCLUDE 'select2.inc' %]
527
    [% INCLUDE 'select2.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js (-86 / +42 lines)
Lines 760-805 $("#placeBookingModal").on("show.bs.modal", function (e) { Link Here
760
                }
760
                }
761
761
762
                // Add hints for days before the start range and after the end range
762
                // Add hints for days before the start range and after the end range
763
                let leadDays = 2;
763
                const leadDays = 2;
764
                let trailDays = 3;
764
                const trailDays = 3;
765
                periodPicker.calendarContainer.addEventListener(
765
                periodPicker.calendarContainer.addEventListener(
766
                    "mouseover",
766
                    "mouseover",
767
                    function (e) {
767
                    function (event) {
768
                        const target = e.target;
768
                        const target = event.target;
769
                        const startDate = periodPicker.selectedDates[0]
770
                            ? dayjs(periodPicker.selectedDates[0]).startOf(
771
                                  "day"
772
                              )
773
                            : null;
774
775
                        if (target.classList.contains("flatpickr-day")) {
769
                        if (target.classList.contains("flatpickr-day")) {
776
                            const hoverDate = dayjs(target.dateObj).startOf(
770
                            const hoverDate = dayjs(target.dateObj).startOf(
777
                                "day"
771
                                "day"
778
                            );
772
                            );
779
                            let leadStart;
773
                            const startDate = periodPicker.selectedDates[0]
780
                            let leadEnd;
774
                                ? dayjs(periodPicker.selectedDates[0]).startOf(
781
                            const trailStart = hoverDate
775
                                      "day"
782
                                .add(0, "day")
776
                                  )
783
                                .startOf("day");
777
                                : null;
784
                            const trailEnd = hoverDate
778
785
                                .add(trailDays, "day")
779
                            const leadStart = startDate
786
                                .startOf("day");
780
                                ? startDate.subtract(leadDays, "day")
787
781
                                : hoverDate.subtract(leadDays, "day");
788
                            if (!startDate) {
782
                            const leadEnd = startDate ? startDate : hoverDate;
789
                                leadStart = hoverDate
783
                            const trailStart = hoverDate;
790
                                    .subtract(leadDays, "day")
784
                            const trailEnd = hoverDate.add(trailDays, "day");
791
                                    .startOf("day");
792
                                leadEnd = hoverDate
793
                                    .subtract(0, "day")
794
                                    .startOf("day");
795
                            } else {
796
                                leadStart = startDate
797
                                    .subtract(leadDays, "day")
798
                                    .startOf("day");
799
                                leadEnd = startDate
800
                                    .subtract(0, "day")
801
                                    .startOf("day");
802
                            }
803
785
804
                            periodPicker.calendarContainer
786
                            periodPicker.calendarContainer
805
                                .querySelectorAll(".flatpickr-day")
787
                                .querySelectorAll(".flatpickr-day")
Lines 808-864 $("#placeBookingModal").on("show.bs.modal", function (e) { Link Here
808
                                        dayElem.dateObj
790
                                        dayElem.dateObj
809
                                    ).startOf("day");
791
                                    ).startOf("day");
810
792
811
                                    if (elemDate.isSame(leadStart)) {
793
                                    dayElem.classList.toggle(
812
                                        dayElem.classList.add("leadRangeStart");
794
                                        "leadRangeStart",
813
                                    } else {
795
                                        elemDate.isSame(leadStart)
814
                                        dayElem.classList.remove(
796
                                    );
815
                                            "leadRangeStart"
797
                                    dayElem.classList.toggle(
816
                                        );
798
                                        "leadRange",
817
                                    }
799
                                        elemDate.isSameOrAfter(leadStart) &&
818
800
                                            elemDate.isBefore(leadEnd)
819
                                    if (
801
                                    );
820
                                        elemDate >= leadStart &&
802
                                    dayElem.classList.toggle(
821
                                        elemDate < leadEnd
803
                                        "leadRangeEnd",
822
                                    ) {
804
                                        elemDate.isSame(leadEnd)
823
                                        dayElem.classList.add("leadRange");
805
                                    );
824
                                    } else {
806
                                    dayElem.classList.toggle(
825
                                        dayElem.classList.remove("leadRange");
807
                                        "trailRangeStart",
826
                                    }
808
                                        elemDate.isSame(trailStart)
827
809
                                    );
828
                                    if (elemDate.isSame(leadEnd)) {
810
                                    dayElem.classList.toggle(
829
                                        dayElem.classList.add("leadRangeEnd");
811
                                        "trailRange",
830
                                    } else {
812
                                        elemDate.isAfter(trailStart) &&
831
                                        dayElem.classList.remove(
813
                                            elemDate.isSameOrBefore(trailEnd)
832
                                            "leadRangeEnd"
814
                                    );
833
                                        );
815
                                    dayElem.classList.toggle(
834
                                    }
816
                                        "trailRangeEnd",
835
817
                                        elemDate.isSame(trailEnd)
836
                                    if (elemDate.isSame(trailStart)) {
818
                                    );
837
                                        dayElem.classList.add(
838
                                            "trailRangeStart"
839
                                        );
840
                                    } else {
841
                                        dayElem.classList.remove(
842
                                            "trailRangeStart"
843
                                        );
844
                                    }
845
846
                                    if (
847
                                        elemDate > trailStart &&
848
                                        elemDate <= trailEnd
849
                                    ) {
850
                                        dayElem.classList.add("trailRange");
851
                                    } else {
852
                                        dayElem.classList.remove("trailRange");
853
                                    }
854
855
                                    if (elemDate.isSame(trailEnd)) {
856
                                        dayElem.classList.add("trailRangeEnd");
857
                                    } else {
858
                                        dayElem.classList.remove(
859
                                            "trailRangeEnd"
860
                                        );
861
                                    }
862
                                });
819
                                });
863
                        }
820
                        }
864
                    }
821
                    }
865
- 

Return to bug 34440