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

(-)a/koha-tmpl/intranet-tmpl/prog/css/src/_flatpickr.scss (+4 lines)
Lines 958-960 span.flatpickr-weekday { Link Here
958
.flatpickr-day {
958
.flatpickr-day {
959
    border-radius: 0;
959
    border-radius: 0;
960
}
960
}
961
962
.flatpickr_wrapper {
963
    white-space: nowrap;
964
}
(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (-1 / +6 lines)
Lines 58-63 a { Link Here
58
    &.clear_date {
58
    &.clear_date {
59
        color: #C33;
59
        color: #C33;
60
        font-size: 130%;
60
        font-size: 130%;
61
62
        &:hover {
63
            color: #FF9090;
64
        }
61
    }
65
    }
62
66
63
    &.close {
67
    &.close {
Lines 219-225 aside { Link Here
219
                width: 100%;
223
                width: 100%;
220
            }
224
            }
221
225
222
            .hasDatepicker {
226
            .hasDatepicker,
227
            .flatpickr-input {
223
                margin-right: 3px;
228
                margin-right: 3px;
224
                width: calc(100% - 20px);
229
                width: calc(100% - 20px);
225
            }
230
            }
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc (-2 / +4 lines)
Lines 60-67 Link Here
60
                <legend>Add manual restriction</legend>
60
                <legend>Add manual restriction</legend>
61
                <ol>
61
                <ol>
62
                    <li><label for="rcomment">Comment:</label> <input type="text" id="rcomment" name="comment" /></li>
62
                    <li><label for="rcomment">Comment:</label> <input type="text" id="rcomment" name="comment" /></li>
63
                    <li><label for="rexpiration">Expiration:</label> <input name="expiration" id="rexpiration" size="20" value="" class="datepicker" type="text" />
63
                    <li>
64
                        <a href="#" class="clear-date" id="clear-date-rexpiration">Clear date</a></li>
64
                        <label for="rexpiration">Expiration:</label>
65
                        <input name="expiration" id="rexpiration" size="20" value="" class="flatpickr futuredate" type="text" />
66
                    </li>
65
                </ol>
67
                </ol>
66
            <fieldset class="action"><input type="submit" value="Add restriction" /> <a href="#" class="cancel" id="cancel_manual_restriction">Cancel</a></fieldset>
68
            <fieldset class="action"><input type="submit" value="Add restriction" /> <a href="#" class="cancel" id="cancel_manual_restriction">Cancel</a></fieldset>
67
            </fieldset>
69
            </fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc (+19 lines)
Lines 31-37 Link Here
31
        },
31
        },
32
        onReady: function( selectedDates, dateStr, instance ){
32
        onReady: function( selectedDates, dateStr, instance ){
33
            /* When flatpickr instance is created, automatically append a "clear date" link */
33
            /* When flatpickr instance is created, automatically append a "clear date" link */
34
            if( $(instance.input).hasClass("futuredate") ){
35
                instance.set("minDate", new Date().fp_incr(1));
36
            }
34
            $(instance.input)
37
            $(instance.input)
38
                /* Add a wrapper element so that we can prevent the clear button from wrapping */
39
                .wrap("<span class='flatpickr_wrapper'></span>")
35
                .after( $("<a/>")
40
                .after( $("<a/>")
36
                    .attr("href","#")
41
                    .attr("href","#")
37
                    .addClass("clear_date")
42
                    .addClass("clear_date")
Lines 48-52 Link Here
48
            validate_date( selectedDates, instance );
53
            validate_date( selectedDates, instance );
49
        },
54
        },
50
    });
55
    });
56
    $(document).ready(function(){
57
        $(".flatpickr").flatpickr();
58
        var startPicker = $(".flatpickrfrom").flatpickr({
59
            onClose: function( selectedDates, dateText, instance) {
60
                validate_date( selectedDates, instance );
61
                endPicker.set('minDate', selectedDates[0]);
62
            }
63
        });
64
        var endPicker = $(".flatpickrto").flatpickr({
65
            onClose: function( selectedDates, dateText, instance) {
66
                validate_date( selectedDates, instance );
67
            },
68
        });
69
    });
51
</script>
70
</script>
52
[% END %]
71
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc (-5 / +5 lines)
Lines 112-124 Link Here
112
            <td>[% hold.notes | html | html_line_break %]</td>
112
            <td>[% hold.notes | html | html_line_break %]</td>
113
            <td>
113
            <td>
114
                [% IF Koha.Preference('AllowHoldDateInFuture') %]
114
                [% IF Koha.Preference('AllowHoldDateInFuture') %]
115
                    <input type="text" class="datepicker" value="[% hold.date | $KohaDates %]" required="required" size="10" name="reservedate" />
115
                    <input type="text" class="flatpickr" value="[% hold.date | $KohaDates %]" required="required" size="10" name="reservedate" />
116
                [% ELSE %]
116
                [% ELSE %]
117
                    [% hold.date | $KohaDates %]
117
                    [% hold.date | $KohaDates %]
118
                [% END %]
118
                [% END %]
119
            </td>
119
            </td>
120
            <td><input type="text" class="datepicker futuredate" value="[% hold.expirationdate | $KohaDates %]" size="10" name="expirationdate" /></td>
120
            <td>
121
121
                <input type="text" class="flatpickr futuredate" value="[% hold.expirationdate | $KohaDates %]" size="10" name="expirationdate" />
122
            </td>
122
            <td>
123
            <td>
123
                [% IF ( hold.found ) %]
124
                [% IF ( hold.found ) %]
124
                    [% IF ( hold.atdestination ) %]
125
                    [% IF ( hold.atdestination ) %]
Lines 208-215 Link Here
208
209
209
                        [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
210
                        [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
210
                            <label for="suspend_until_[% hold.reserve_id | html %]">[% IF ( hold.suspend ) %] on [% ELSE %] until [% END %]</label>
211
                            <label for="suspend_until_[% hold.reserve_id | html %]">[% IF ( hold.suspend ) %] on [% ELSE %] until [% END %]</label>
211
                            <input type="text" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" size="10" value="[% hold.suspend_until | $KohaDates %]" class="datepicker suspend_until_datepicker" />
212
                            <input type="text" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" size="10" value="[% hold.suspend_until | $KohaDates %]" class="suspend_until_datepicker" />
212
                            <a href='#' onclick="document.getElementById('suspend_until_[% hold.reserve_id | html %]').value='';">Clear date</a>
213
                        [% ELSE %]
213
                        [% ELSE %]
214
                            <input type="hidden" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" value=""/>
214
                            <input type="hidden" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" value=""/>
215
                        [% END %]
215
                        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-17 / +1 lines)
Lines 636-642 Link Here
636
                                                                [% ELSE %]
636
                                                                [% ELSE %]
637
                                                                    <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" />
637
                                                                    <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" />
638
                                                                [% END %]
638
                                                                [% END %]
639
                                                                <button class="btn btn-default btn-xs action" id="cleardate" name="cleardate" onclick="this.checked = false; this.form.duedatespec.value = ''; this.form.stickyduedate.checked = false; this.form.barcode.focus(); return false;" >Clear</button>
640
                                                            </div>
639
                                                            </div>
641
                                                        [% END %]
640
                                                        [% END %]
642
                                                    [% END %]
641
                                                    [% END %]
Lines 884-890 Link Here
884
883
885
                                            [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
884
                                            [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
886
                                            <label for="suspend_until">until</label>
885
                                            <label for="suspend_until">until</label>
887
                                            <input type="text" size="10" id="suspend_until" name="suspend_until" class="datepicker futuredate"/>
886
                                            <input type="text" size="10" id="suspend_until" name="suspend_until" class="flatpickr futuredate"/>
888
                                            <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
887
                                            <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
889
                                             [% END %]
888
                                             [% END %]
890
                                        </form>
889
                                        </form>
Lines 1013-1033 Link Here
1013
        function toggle_onsite_checkout(){
1012
        function toggle_onsite_checkout(){
1014
            if ( $("#onsite_checkout").prop('checked') ) {
1013
            if ( $("#onsite_checkout").prop('checked') ) {
1015
                $("#duedatespec").val("[% todaysdate | $KohaDates  with_hours => 1 %]")
1014
                $("#duedatespec").val("[% todaysdate | $KohaDates  with_hours => 1 %]")
1016
                [% IF !Koha.Preference('SpecifyDueDate') %]
1017
                    $("#duedatespec").datetimepicker('destroy');
1018
                [% END %]
1019
            } else {
1020
                $("#duedatespec").datetimepicker({
1021
                    onClose: function(dateText, inst) {
1022
                        if (validate_date(dateText, inst) ) {
1023
                            $("#barcode").focus();
1024
                        }
1025
                    },
1026
                    hour: 23,
1027
                    minute: 59
1028
                }).on("change", function(e, value) {
1029
                    if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
1030
                });
1031
            }
1015
            }
1032
        }
1016
        }
1033
1017
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt (-8 / +4 lines)
Lines 359-372 Link Here
359
            }));
359
            }));
360
360
361
            [% IF Koha.Preference('SpecifyDueDate') %]
361
            [% IF Koha.Preference('SpecifyDueDate') %]
362
                $("#duedatespec").datetimepicker({
362
               $("#duedatespec").flatpickr({
363
                    onClose: function(dateText, inst) {
363
                    enableTime: true,
364
                        validate_date(dateText, inst);
364
                    dateFormat: flatpickr_dateformat_string + " " + flatpickr_timeformat_string,
365
                    },
365
                    defaultDate: new Date().setHours(23, 59, 0, 0) /* Today a 11:59PM */
366
                    hour: 23,
367
                    minute: 59
368
                }).on("change", function(e, value) {
369
                    if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
370
                });
366
                });
371
            [% END %]
367
            [% END %]
372
        });
368
        });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt (-9 lines)
Lines 456-470 Link Here
456
        [% END %]
456
        [% END %]
457
        }
457
        }
458
458
459
        function validate1(date) {
460
            var today = new Date();
461
            if ( date < today ) {
462
                return true;
463
             } else {
464
                return false;
465
             }
466
        };
467
468
        function loadPatron(barcode) {
459
        function loadPatron(barcode) {
469
            $('#oldissues').hide();
460
            $('#oldissues').hide();
470
            $('#session-issues').hide();
461
            $('#session-issues').hide();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt (-2 / +2 lines)
Lines 156-166 Link Here
156
156
157
            <li class="date_due_filter">
157
            <li class="date_due_filter">
158
                <label for="from">From:</label>
158
                <label for="from">From:</label>
159
                <input type="text" id="from" name="dateduefrom" size="10" value="[% filters.dateduefrom | $KohaDates %]" class="datepickerfrom" />
159
                <input type="text" id="from" name="dateduefrom" size="10" value="[% filters.dateduefrom | $KohaDates %]" class="flatpickrfrom" />
160
            </li>
160
            </li>
161
            <li class="date_due_filter">
161
            <li class="date_due_filter">
162
                <label for="to">To:</label>
162
                <label for="to">To:</label>
163
                <input type="text" id="to" name="datedueto" size="10" value="[% filters.datedueto | $KohaDates %]" class="datepickerto" />
163
                <input type="text" id="to" name="datedueto" size="10" value="[% filters.datedueto | $KohaDates %]" class="flatpickrto" />
164
            </li>
164
            </li>
165
        </ol>
165
        </ol>
166
    </fieldset>
166
    </fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt (-2 / +2 lines)
Lines 271-282 Link Here
271
<label for="from">
271
<label for="from">
272
    Start date:
272
    Start date:
273
</label>
273
</label>
274
<input type="text" size="10" id="from" name="from" value="[% from | $KohaDates %]" class="datepickerfrom" />
274
<input type="text" size="10" id="from" name="from" value="[% from | $KohaDates %]" class="flatpickrfrom" />
275
</li>
275
</li>
276
<li><label for="to">
276
<li><label for="to">
277
    End date:
277
    End date:
278
</label>
278
</label>
279
<input type="text" size="10" id="to" name="to" value="[% to | $KohaDates %]" class="datepickerto" />
279
<input type="text" size="10" id="to" name="to" value="[% to | $KohaDates %]" class="flatpickrto" />
280
</li>
280
</li>
281
</ol>
281
</ol>
282
282
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt (-2 / +2 lines)
Lines 164-175 Link Here
164
164
165
    <li>
165
    <li>
166
        <label for="from">Start date:</label>
166
        <label for="from">Start date:</label>
167
        <input type="text" size="10" id="from" name="from" value="[% from | $KohaDates %]" class="datepickerfrom" />
167
        <input type="text" size="10" id="from" name="from" value="[% from | $KohaDates %]" class="flatpickrfrom" />
168
    </li>
168
    </li>
169
169
170
    <li>
170
    <li>
171
        <label for="to">End date:</label>
171
        <label for="to">End date:</label>
172
        <input size="10" id="to" name="to" value="[% to | $KohaDates %]" type="text" class="datepickerto" />
172
        <input size="10" id="to" name="to" value="[% to | $KohaDates %]" type="text" class="flatpickrto" />
173
    </li>
173
    </li>
174
</ol>
174
</ol>
175
(inclusive)
175
(inclusive)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt (-2 / +2 lines)
Lines 217-227 Link Here
217
                    <li>
217
                    <li>
218
                      <label for="date" class="required">Date: </label>
218
                      <label for="date" class="required">Date: </label>
219
                      [% IF ( visit ) %]
219
                      [% IF ( visit ) %]
220
                        <input type="text" id="date" class="datepicker required"
220
                        <input type="text" id="date" class="flatpickr required"
221
                               value="[% visit.appointment_date | $KohaDates %]"
221
                               value="[% visit.appointment_date | $KohaDates %]"
222
                               name="date" size="20" required="required"/>
222
                               name="date" size="20" required="required"/>
223
                      [% ELSE %]
223
                      [% ELSE %]
224
                        <input type="text" id="date" class="datepicker required"
224
                        <input type="text" id="date" class="flatpickr required"
225
                               value="" name="date" size="20" required="required"/>
225
                               value="" name="date" size="20" required="required"/>
226
                      [% END %]
226
                      [% END %]
227
                      <span class="required">Required</span>
227
                      <span class="required">Required</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-5 / +5 lines)
Lines 347-353 legend:hover { Link Here
347
                                                        [% END %]
347
                                                        [% END %]
348
                                                        Date of birth:
348
                                                        Date of birth:
349
                                                        </label>
349
                                                        </label>
350
                                                        <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="[% dateofbirth | html UNLESS opduplicate %]" class="datepicker" />
350
                                                        <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="[% dateofbirth | html UNLESS opduplicate %]" class="flatpickr" />
351
                                                         [% IF ( mandatorydateofbirth ) %]
351
                                                         [% IF ( mandatorydateofbirth ) %]
352
                                                            <span class="required">Required</span>
352
                                                            <span class="required">Required</span>
353
                                                        [% END %]
353
                                                        [% END %]
Lines 1055-1061 legend:hover { Link Here
1055
                                                [% END %]
1055
                                                [% END %]
1056
                                                    Registration date:
1056
                                                    Registration date:
1057
                                                </label>
1057
                                                </label>
1058
                                                <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" value="[% dateenrolled | html %]" class="datepickerfrom" />
1058
                                                <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" value="[% dateenrolled | html %]" class="flatpickrfrom" />
1059
                                                [% IF ( mandatorydateenrolled ) %]
1059
                                                [% IF ( mandatorydateenrolled ) %]
1060
                                                    <span class="required">Required</span>
1060
                                                    <span class="required">Required</span>
1061
                                                [% END %]
1061
                                                [% END %]
Lines 1079-1087 legend:hover { Link Here
1079
                                                    Expiry date (leave blank for auto calc):
1079
                                                    Expiry date (leave blank for auto calc):
1080
                                                </label>
1080
                                                </label>
1081
                                                [% UNLESS ( opadd ) %]
1081
                                                [% UNLESS ( opadd ) %]
1082
                                                    <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" value="[% dateexpiry | html UNLESS opduplicate %]" class="datepickerto" />
1082
                                                    <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" value="[% dateexpiry | html UNLESS opduplicate %]" class="flatpickrto" />
1083
                                                [% ELSE %]
1083
                                                [% ELSE %]
1084
                                                    <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" value="[% dateexpiry | html %]" class="datepickerto" />
1084
                                                    <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" value="[% dateexpiry | html %]" class="flatpickrto" />
1085
                                                [% END %]
1085
                                                [% END %]
1086
                                                [% IF ( mandatorydateexpiry ) %]
1086
                                                [% IF ( mandatorydateexpiry ) %]
1087
                                                    <span class="required">Required</span>
1087
                                                    <span class="required">Required</span>
Lines 1373-1379 legend:hover { Link Here
1373
                                                    </li>
1373
                                                    </li>
1374
                                                    <li>
1374
                                                    <li>
1375
                                                        <label for="debarred_expiration">Expiration: </label>
1375
                                                        <label for="debarred_expiration">Expiration: </label>
1376
                                                        <input name="debarred_expiration" id="debarred_expiration" size="10" value="" class="datepicker" type="text" />
1376
                                                        <input name="debarred_expiration" id="debarred_expiration" size="10" value="" class="flatpickr" type="text" />
1377
                                                        <a href="#" id="clear_debarred_expiration">Clear date</a>
1377
                                                        <a href="#" id="clear_debarred_expiration">Clear date</a>
1378
                                                    </li>
1378
                                                    </li>
1379
                                                </ol>
1379
                                                </ol>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-10 / +1 lines)
Lines 810-816 Link Here
810
810
811
                                                [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
811
                                                [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
812
                                                    <label for="suspend_until">until</label>
812
                                                    <label for="suspend_until">until</label>
813
                                                    <input type="text" size="10" id="suspend_until" name="suspend_until" class="datepicker futuredate"/>
813
                                                    <input type="text" size="10" id="suspend_until" name="suspend_until" class="flatpickr futuredate"/>
814
                                                    <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
814
                                                    <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
815
                                                [% END %]
815
                                                [% END %]
816
                                            </fieldset>
816
                                            </fieldset>
Lines 952-966 Link Here
952
               }
952
               }
953
            }
953
            }
954
        }
954
        }
955
956
        function validate1(date) {
957
            var today = new Date();
958
            if ( date < today ) {
959
                return true;
960
            } else {
961
                return false;
962
            }
963
        };
964
    </script>
955
    </script>
965
[% END %]
956
[% END %]
966
957
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-9 / +27 lines)
Lines 492-508 Link Here
492
                            [% IF ( reserve_in_future ) %]
492
                            [% IF ( reserve_in_future ) %]
493
                                <li>
493
                                <li>
494
                                    <label for="from">Hold starts on date:</label>
494
                                    <label for="from">Hold starts on date:</label>
495
                                    <input name="reserve_date" id="from" size="10" class="datepickerfrom" type="text" >
495
                                    <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" >
496
                                    <input type="hidden" class="datepickerfrom_hidden" />
496
                                    <input type="hidden" class="datepickerfrom_hidden" />
497
                                    <a href="#" id="clear-date-from" class="clear-date">Clear date</a>
498
                                </li>
497
                                </li>
499
                            [% END %]
498
                            [% END %]
500
499
501
                            <li>
500
                            <li>
502
                                <label for="to">Hold expires on date:</label>
501
                                <label for="to">Hold expires on date:</label>
503
                                <input name="expiration_date" id="to" size="10" class="datepickerto" type="text" />
502
                                <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" />
504
                                <input type="hidden" class="datepickerto_hidden" />
503
                                <input type="hidden" class="datepickerto_hidden" />
505
                                <a href="#" id="clear-date-to" class="clear-date">Clear date</a>
506
                            </li>
504
                            </li>
507
505
508
                            [% UNLESS ( multi_hold ) %]
506
                            [% UNLESS ( multi_hold ) %]
Lines 1141-1154 Link Here
1141
            [% END %]
1139
            [% END %]
1142
1140
1143
            [% IF AutoResumeSuspendedHolds %]
1141
            [% IF AutoResumeSuspendedHolds %]
1144
                $(".suspend_until_datepicker, .datepickerfrom, .datepickerto").datepicker("option", "minDate", 1);
1142
                $(".suspend_until_datepicker").flatpickr({
1143
                    minDate: new Date().fp_incr(1) /* Require that "until date" be in the future */
1144
                });
1145
            [% END %]
1145
            [% END %]
1146
1146
1147
            $(".datepickerto").datepicker("option", "altField", ".datepickerto_hidden");
1148
            $(".datepickerto").datepicker("option", "altFormat", "yy-mm-dd");
1149
1147
1150
            $(".datepickerfrom").datepicker("option", "altField", ".datepickerfrom_hidden");
1148
            var startPicker = $("#reserve_date").flatpickr({
1151
            $(".datepickerfrom").datepicker("option", "altFormat", "yy-mm-dd");
1149
                minDate: new Date().fp_incr(1), /* Require that "Hold starts on date" be in the future */
1150
                onChange: function(selectedDates, dateStr, instance) {
1151
                    altFormat = instance.formatDate(selectedDates[0], "Y-m-d");
1152
                    $(".datepickerfrom_hidden").val( altFormat ); /* Populate hidden field with ISO-formatted date */
1153
                },
1154
                onClose: function( selectedDates, dateText, instance) {
1155
                    validate_date( selectedDates, instance );
1156
                    endPicker.set('minDate', selectedDates[0]);
1157
                }
1158
            });
1159
1160
            var endPicker = $("#expiration_date").flatpickr({
1161
                minDate: new Date().fp_incr(1), // Require that "Hold expires on date" be in the future
1162
                onChange: function(selectedDates, dateStr, instance) {
1163
                    altFormat = instance.formatDate(selectedDates[0], "Y-m-d");
1164
                    $(".datepickerto_hidden").val( altFormat ); /* Populate hidden field with ISO-formatted date */
1165
                },
1166
                onClose: function( selectedDates, dateText, instance) {
1167
                    validate_date( selectedDates, instance );
1168
                },
1169
            });
1152
1170
1153
            var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1171
            var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1154
                'bPaginate': false,
1172
                'bPaginate': false,
(-)a/koha-tmpl/intranet-tmpl/prog/js/calendar.js (-8 lines)
Lines 186-199 $(document).ready(function () { Link Here
186
        yearRange: "c-100:c+10"
186
        yearRange: "c-100:c+10"
187
    });
187
    });
188
188
189
    $("#dateofbirth").datepicker({
190
        yearRange: "c-100:c"
191
    });
192
193
    $(".futuredate").datepicker({
194
        minDate: 1, // require that hold suspended until date is after today
195
    });
196
197
    $(".datepicker").datepicker({
189
    $(".datepicker").datepicker({
198
        onClose: function (dateText, inst) {
190
        onClose: function (dateText, inst) {
199
            validate_date(dateText, inst);
191
            validate_date(dateText, inst);
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-5 / +5 lines)
Lines 233-239 $(document).ready(function() { Link Here
233
        return false;
233
        return false;
234
    });
234
    });
235
235
236
    var ymd = $.datepicker.formatDate('yy-mm-dd', new Date());
236
    var ymd = flatpickr.formatDate(new Date(), "Y-m-d");
237
237
238
    $('#issues-table').hide();
238
    $('#issues-table').hide();
239
    $('#issues-table-actions').hide();
239
    $('#issues-table-actions').hide();
Lines 341-347 $(document).ready(function() { Link Here
341
341
342
                        if ( oObj.itemnotes ) {
342
                        if ( oObj.itemnotes ) {
343
                            var span_class = "text-muted";
343
                            var span_class = "text-muted";
344
                            if ( $.datepicker.formatDate('yy-mm-dd', new Date(oObj.issuedate) ) == ymd ) {
344
                            if ( flatpickr.formatDate( new Date(oObj.issuedate), "Y-m-d" ) == ymd ){
345
                                span_class = "circ-hlt";
345
                                span_class = "circ-hlt";
346
                            }
346
                            }
347
                            title += " - <span class='" + span_class + " item-note-public'>" + oObj.itemnotes.escapeHtml() + "</span>";
347
                            title += " - <span class='" + span_class + " item-note-public'>" + oObj.itemnotes.escapeHtml() + "</span>";
Lines 349-355 $(document).ready(function() { Link Here
349
349
350
                        if ( oObj.itemnotes_nonpublic ) {
350
                        if ( oObj.itemnotes_nonpublic ) {
351
                            var span_class = "text-danger";
351
                            var span_class = "text-danger";
352
                            if ( $.datepicker.formatDate('yy-mm-dd', new Date(oObj.issuedate) ) == ymd ) {
352
                            if ( flatpickr.formatDate( new Date(oObj.issuedate), "Y-m-d" ) == ymd ){
353
                                span_class = "circ-hlt";
353
                                span_class = "circ-hlt";
354
                            }
354
                            }
355
                            title += " - <span class='" + span_class + " item-note-nonpublic'>" + oObj.itemnotes_nonpublic.escapeHtml() + "</span>";
355
                            title += " - <span class='" + span_class + " item-note-nonpublic'>" + oObj.itemnotes_nonpublic.escapeHtml() + "</span>";
Lines 732-738 $(document).ready(function() { Link Here
732
732
733
                            if ( oObj.itemnotes ) {
733
                            if ( oObj.itemnotes ) {
734
                                var span_class = "";
734
                                var span_class = "";
735
                                if ( $.datepicker.formatDate('yy-mm-dd', new Date(oObj.issuedate) ) == ymd ) {
735
                                if ( flatpickr.formatDate( new Date(oObj.issuedate), "Y-m-d" ) == ymd ){
736
                                    span_class = "circ-hlt";
736
                                    span_class = "circ-hlt";
737
                                }
737
                                }
738
                                title += " - <span class='" + span_class + "'>" + oObj.itemnotes.escapeHtml() + "</span>"
738
                                title += " - <span class='" + span_class + "'>" + oObj.itemnotes.escapeHtml() + "</span>"
Lines 740-746 $(document).ready(function() { Link Here
740
740
741
                            if ( oObj.itemnotes_nonpublic ) {
741
                            if ( oObj.itemnotes_nonpublic ) {
742
                                var span_class = "";
742
                                var span_class = "";
743
                                if ( $.datepicker.formatDate('yy-mm-dd', new Date(oObj.issuedate) ) == ymd ) {
743
                                if ( flatpickr.formatDate( new Date(oObj.issuedate), "Y-m-d" ) == ymd ){
744
                                    span_class = "circ-hlt";
744
                                    span_class = "circ-hlt";
745
                                }
745
                                }
746
                                title += " - <span class='" + span_class + "'>" + oObj.itemnotes_nonpublic.escapeHtml() + "</span>"
746
                                title += " - <span class='" + span_class + "'>" + oObj.itemnotes_nonpublic.escapeHtml() + "</span>"
(-)a/koha-tmpl/intranet-tmpl/prog/js/holds.js (-2 / +4 lines)
Lines 44-50 $(document).ready(function() { Link Here
44
44
45
                            if ( oObj.itemnotes ) {
45
                            if ( oObj.itemnotes ) {
46
                                var span_class = "";
46
                                var span_class = "";
47
                                if ( $.datepicker.formatDate('yy-mm-dd', new Date(oObj.issuedate) ) == ymd ) {
47
                                if ( flatpickr.formatDate( new Date(oObj.issuedate), "Y-m-d" ) == ymd ){
48
                                    span_class = "circ-hlt";
48
                                    span_class = "circ-hlt";
49
                                }
49
                                }
50
                                title += " - <span class='" + span_class + "'>" + oObj.itemnotes.escapeHtml() + "</span>"
50
                                title += " - <span class='" + span_class + "'>" + oObj.itemnotes.escapeHtml() + "</span>"
Lines 335-341 $(document).ready(function() { Link Here
335
        </div>\
335
        </div>\
336
    ");
336
    ");
337
337
338
    $("#suspend-modal-until").datepicker({ minDate: 1 }); // Require that "until date" be in the future
338
    $("#suspend-modal-until").flatpickr({
339
        minDate: new Date().fp_incr(1) // Require that "until date" be in the future
340
    });
339
    $("#suspend-modal-clear-date").on( "click", function() { $("#suspend-modal-until").val(""); } );
341
    $("#suspend-modal-clear-date").on( "click", function() { $("#suspend-modal-until").val(""); } );
340
342
341
    $("#suspend-modal-submit").on( "click", function( e ) {
343
    $("#suspend-modal-submit").on( "click", function( e ) {
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js (-20 / +13 lines)
Lines 1-3 Link Here
1
/* global flatpickr_dateformat_string flatpickr_timeformat_string */
1
$(document).ready(function() {
2
$(document).ready(function() {
2
    $("#CheckAllExports").on("click",function(){
3
    $("#CheckAllExports").on("click",function(){
3
        $(".export:visible").prop("checked", true);
4
        $(".export:visible").prop("checked", true);
Lines 38-54 $(document).ready(function() { Link Here
38
    }).on("change", function(e) {
39
    }).on("change", function(e) {
39
        if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
40
        if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
40
    });
41
    });
41
    $("#duedatespec").datetimepicker({
42
42
        onClose: function(dateText, inst) {
43
    $("#duedatespec").flatpickr({
43
            if ( validate_date(dateText, inst) ) {
44
        enableTime: true,
44
                $("#barcode").focus();
45
        dateFormat: flatpickr_dateformat_string + " " + flatpickr_timeformat_string,
45
            }
46
        onClose: function() {
46
        },
47
            $("#barcode").focus();
47
        hour: 23,
48
        }
48
        minute: 59
49
    });
49
    }).on("change", function(e, value) {
50
50
        if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
51
    $(".clear_date").on("click", function(){
52
        $("#stickyduedate").prop( "checked", false );
51
    });
53
    });
54
52
    $("#export_submit").on("click",function(){
55
    $("#export_submit").on("click",function(){
53
        export_checkouts($("#issues-table-output-format").val());
56
        export_checkouts($("#issues-table-output-format").val());
54
        return false;
57
        return false;
Lines 136-147 function export_checkouts(format) { Link Here
136
    document.getElementById("output_format").value = format;
139
    document.getElementById("output_format").value = format;
137
    document.issues.submit();
140
    document.issues.submit();
138
}
141
}
139
140
function validate1(date) {
141
    var today = new Date();
142
    if ( date < today ) {
143
        return true;
144
     } else {
145
        return false;
146
     }
147
}
148
- 

Return to bug 28937