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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc (-1 / +2 lines)
Lines 157-163 Link Here
157
            }
157
            }
158
            if ( $(this).data('flatpickr-enable-time') === true ) {
158
            if ( $(this).data('flatpickr-enable-time') === true ) {
159
                options['enableTime'] = true;
159
                options['enableTime'] = true;
160
                options['dateFormat'] = flatpickr_dateformat_string + " " + flatpickr_timeformat_string;
160
                options['dateFormat'] = "Y-m-d H:i";
161
                options['altFormat'] = flatpickr_dateformat_string + " " + flatpickr_timeformat_string;
161
            }
162
            }
162
163
163
            let fp = $(this).flatpickr(options);
164
            let fp = $(this).flatpickr(options);
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc (-2 / +2 lines)
Lines 10-17 Link Here
10
            <td colspan="3">
10
            <td colspan="3">
11
        [% END %]
11
        [% END %]
12
            <div class="date-select">
12
            <div class="date-select">
13
                <p><label for="newduedate">Renewal due date:</label> <input type="text" size="20" id="newduedate" name="newduedate" value="" /></p>
13
                <p><label for="newduedate">Renewal due date:</label> <input type="text" size="20" id="newduedate" name="newduedate" value="" class="flatpickr" data-flatpickr-enable-time="true"/></p>
14
                <p id="newonholdduedate"><label for="newonholdduedate">On hold due date:</label> <input type="text" size="20" name="newonholdduedate" value="" /></p>
14
                <p id="newonholdduedate"><label for="newonholdduedate">On hold due date:</label> <input type="text" size="20" name="newonholdduedate" value="" class="flatpickr" data-flatpickr-enable-time="true" /></p>
15
                <p><label for="exemptfine">Forgive fines on return:</label> <input type="checkbox" id="exemptfine" name="exemptfine" value="1" /></p>
15
                <p><label for="exemptfine">Forgive fines on return:</label> <input type="checkbox" id="exemptfine" name="exemptfine" value="1" /></p>
16
            </div>
16
            </div>
17
		</td>
17
		</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-4 / +4 lines)
Lines 317-323 Link Here
317
317
318
                                    [% IF ( INVALID_DATE ) %]
318
                                    [% IF ( INVALID_DATE ) %]
319
                                        <p>
319
                                        <p>
320
                                          <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | $KohaDates with_hours => 1 %]" />
320
                                          <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
321
                                            <label for="duedatespec">Due date</label>
321
                                            <label for="duedatespec">Due date</label>
322
                                        </p>
322
                                        </p>
323
                                    [% ELSE %]
323
                                    [% ELSE %]
Lines 680-688 Link Here
680
                                                        <div id="specify-due-date" class="circ-setting">
680
                                                        <div id="specify-due-date" class="circ-setting">
681
                                                            <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
681
                                                            <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
682
                                                            [% IF ( duedatespec ) %]
682
                                                            [% IF ( duedatespec ) %]
683
                                                                <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" />
683
                                                                <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
684
                                                            [% ELSE %]
684
                                                            [% ELSE %]
685
                                                                <input type="text" size="20" id="duedatespec" name="duedatespec" value="" />
685
                                                                <input type="text" size="20" id="duedatespec" name="duedatespec" value="" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
686
                                                            [% END %]
686
                                                            [% END %]
687
                                                            <label for="stickyduedate"> Remember for session:</label>
687
                                                            <label for="stickyduedate"> Remember for session:</label>
688
                                                            [% IF ( stickyduedate ) %]
688
                                                            [% IF ( stickyduedate ) %]
Lines 747-753 Link Here
747
                                                        [% IF noissues %]
747
                                                        [% IF noissues %]
748
                                                            <div class="onsite-checkout-only">
748
                                                            <div class="onsite-checkout-only">
749
                                                                <input type="checkbox" id="onsite_checkout" name="onsite_checkout_forced" checked="checked" disabled="disabled" /> <label for="onsite_checkout">On-site checkouts only. Automatic due date: </label>
749
                                                                <input type="checkbox" id="onsite_checkout" name="onsite_checkout_forced" checked="checked" disabled="disabled" /> <label for="onsite_checkout">On-site checkouts only. Automatic due date: </label>
750
                                                                <input type="text" name="duedatespec" id="duedatespec" />
750
                                                                <input type="text" name="duedatespec" id="duedatespec" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
751
                                                                <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
751
                                                                <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
752
                                                            </div>
752
                                                            </div>
753
                                                        [% ELSE %]
753
                                                        [% ELSE %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt (-9 / +1 lines)
Lines 140-146 Link Here
140
140
141
                        <div class="date-select">
141
                        <div class="date-select">
142
                            <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
142
                            <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
143
                                <input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" />
143
                                <input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#checkout-barcode" />
144
                            <label for="stickyduedate"> Remember for session:</label>
144
                            <label for="stickyduedate"> Remember for session:</label>
145
                            <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" checked="checked" />
145
                            <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" checked="checked" />
146
                            <input type="button" class="action" id="cleardate" value="Clear" name="cleardate" onclick="this.checked = false; this.form.duedatespec.value = ''; this.form.stickyduedate.checked = false; this.form.barcode.focus(); return false;" />
146
                            <input type="button" class="action" id="cleardate" value="Clear" name="cleardate" onclick="this.checked = false; this.form.duedatespec.value = ''; this.form.stickyduedate.checked = false; this.form.barcode.focus(); return false;" />
Lines 772-785 Link Here
772
                recordFine($('#pay-fine-amount').val());
772
                recordFine($('#pay-fine-amount').val());
773
            });
773
            });
774
774
775
            $("#duedatespec").flatpickr({
776
                enableTime: true,
777
                dateFormat: flatpickr_datetime_string,
778
                onClose: function() {
779
                    $("#checkout-barcode").focus();
780
                }
781
            });
782
783
            $('#mainform').submit(function (event) {
775
            $('#mainform').submit(function (event) {
784
                event.preventDefault();
776
                event.preventDefault();
785
                var barcode = $('#checkout-barcode').val();
777
                var barcode = $('#checkout-barcode').val();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt (-7 / +7 lines)
Lines 72-78 Link Here
72
                                        </li>
72
                                        </li>
73
                                        <li class="dateinsert">
73
                                        <li class="dateinsert">
74
                                            <strong>To date: </strong>
74
                                            <strong>To date: </strong>
75
                                            <input type="text" id="datecancelrange" name="datecancelrange" size="20" value="[% datecancelrange | html %]" />
75
                                            <input type="text" id="datecancelrange" name="datecancelrange" size="20" value="[% datecancelrange | html %]" class="flatpickr" />
76
                                        </li>
76
                                        </li>
77
                                        <li>
77
                                        <li>
78
                                            <label for="showTitle">Title: </label><input type="text" name="showTitle" id="showTitle" size="35" />
78
                                            <label for="showTitle">Title: </label><input type="text" name="showTitle" id="showTitle" size="35" />
Lines 170-176 Link Here
170
                                        </li>
170
                                        </li>
171
                                        <li class="dateinsert">
171
                                        <li class="dateinsert">
172
                                            <strong>To date: </strong>
172
                                            <strong>To date: </strong>
173
                                            <input type="text" id="dateofrange" name="dateofrange" size="20" value="[% dateofrange | html %]" />
173
                                            <input type="text" id="dateofrange" name="dateofrange" size="20" value="[% dateofrange | html %]" class="flatpickr" />
174
                                        </li>
174
                                        </li>
175
                                        <li>
175
                                        <li>
176
                                            <label for="title">Title: </label>
176
                                            <label for="title">Title: </label>
Lines 602-618 Link Here
602
                $(this).parent().find(".hint").toggle(); return false;
602
                $(this).parent().find(".hint").toggle(); return false;
603
            });
603
            });
604
604
605
            var dateofrange = $("#dateofrange").flatpickr();
605
            const dateofrange = document.querySelector("#dateofrange")._flatpickr;
606
606
            const datecancelrange = document.querySelector("#datecancelrange")._flatpickr;
607
            var datecancelrange = $("#datecancelrange").flatpickr();
608
607
609
            $("#dateofrange").each(function () { this.value = "" });
608
            $("#dateofrange").each(function () { this.value = "" });
610
            $("#datecancelrange").each(function () { this.value = "" });
609
            $("#datecancelrange").each(function () { this.value = "" });
611
610
612
            var maincalendar = $("#calendar-anchor").flatpickr({
611
            var maincalendar = $("#calendar-anchor").flatpickr({
613
                inline: true,
612
                inline: true,
614
                onReady: function(){
613
                onReady: function( selectedDates, dateStr, instance ){
615
                    return;
614
                    // We do not want to display the 'close' icon in this case
615
                    $(instance.input).siblings('.flatpickr-input').hide();
616
                },
616
                },
617
                onDayCreate: function( dObj, dStr, fp, dayElem ){
617
                onDayCreate: function( dObj, dStr, fp, dayElem ){
618
                    /* for each day on the calendar, get the
618
                    /* for each day on the calendar, get the
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt (-1 / +6 lines)
Lines 418-424 you can supply dates in ISO format (e.g., '2010-10-28'). Link Here
418
    <script>
418
    <script>
419
        $(document).ready(function() {
419
        $(document).ready(function() {
420
            [%# Make date fields have the datepicker %]
420
            [%# Make date fields have the datepicker %]
421
            $("#dateenrolled, #dateexpiry, #dateofbirth").flatpickr();
421
            $("#dateenrolled, #dateexpiry, #dateofbirth").flatpickr({
422
                altInput: true,
423
                altFormat: flatpickr_dateformat_string,
424
                altInputClass: 'flatpickr-input',
425
                dateFormat: "Y-m-d",
426
            });
422
427
423
            $(".expand_defaults").click(function(e){
428
            $(".expand_defaults").click(function(e){
424
                e.preventDefault();
429
                e.preventDefault();
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js (-15 lines)
Lines 1-4 Link Here
1
/* global flatpickr_dateformat_string flatpickr_timeformat_string */
2
$(document).ready(function() {
1
$(document).ready(function() {
3
    $("#CheckAllExports").on("click",function(){
2
    $("#CheckAllExports").on("click",function(){
4
        $(".export:visible").prop("checked", true);
3
        $(".export:visible").prop("checked", true);
Lines 29-47 $(document).ready(function() { Link Here
29
        radioCheckBox($(this));
28
        radioCheckBox($(this));
30
    });
29
    });
31
30
32
    $("#duedatespec").flatpickr({
33
        enableTime: true,
34
        dateFormat: flatpickr_dateformat_string + " " + flatpickr_timeformat_string,
35
        onClose: function() {
36
            $("#barcode").focus();
37
        }
38
    });
39
40
    $("#newduedate, #newonholdduedate input").flatpickr({
41
        enableTime: true,
42
        dateFormat: flatpickr_dateformat_string + " " + flatpickr_timeformat_string,
43
    });
44
45
    $(".clear_date").on("click", function(){
31
    $(".clear_date").on("click", function(){
46
        $("#stickyduedate").prop( "checked", false );
32
        $("#stickyduedate").prop( "checked", false );
47
    });
33
    });
48
- 

Return to bug 30718