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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc (-23 / +1 lines)
Lines 157-184 Link Here
157
        }
157
        }
158
    }
158
    }
159
159
160
    function Date_from_syspref(dstring) {
161
        var dateX = dstring.split(/[-/.]/);
162
        if (debug > 1 && sentmsg < 1) {
163
            sentmsg++;
164
            alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));
165
        }
166
        if (dateformat_pref === "iso") {
167
            return new Date(dateX[0], (dateX[1] - 1), dateX[2]); // YYYY-MM-DD to (YYYY,m(0-11),d)
168
        } else if (dateformat_pref === "us") {
169
            return new Date(dateX[2], (dateX[0] - 1), dateX[1]); // MM/DD/YYYY to (YYYY,m(0-11),d)
170
        } else if (dateformat_pref === "metric") {
171
            return new Date(dateX[2], (dateX[1] - 1), dateX[0]); // DD/MM/YYYY to (YYYY,m(0-11),d)
172
        } else if (dateformat_pref === "dmydot") {
173
            return new Date(dateX[2], (dateX[1] - 1), dateX[0]); // DD.MM.YYYY to (YYYY,m(0-11),d)
174
        } else {
175
            if (debug > 0) {
176
                alert("KOHA ERROR - Unrecognized date format: " + dateformat_pref);
177
            }
178
            return 0;
179
        }
180
    }
181
182
        $(document).ready(function(){
160
        $(document).ready(function(){
183
            $(".flatpickr").each(function(){
161
            $(".flatpickr").each(function(){
184
                let options = {};
162
                let options = {};
Lines 189-195 Link Here
189
                 || $(this).data("flatpickr-futuredate") === true ) {
167
                 || $(this).data("flatpickr-futuredate") === true ) {
190
                    let original_date = $(this).val();
168
                    let original_date = $(this).val();
191
                    if ( original_date ) {
169
                    if ( original_date ) {
192
                        original_date = Date_from_syspref( original_date ).getTime();
170
                        original_date = flatpickr.parseDate(original_date, 'Y-m-d').getTime();
193
                        let tomorrow = new Date().fp_incr(1).getTime();
171
                        let tomorrow = new Date().fp_incr(1).getTime();
194
172
195
                        options['enable'] = [function(date){
173
                        options['enable'] = [function(date){
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (-1 / +1 lines)
Lines 288-294 Link Here
288
                                                [% IF ( reserve_in_future ) %]
288
                                                [% IF ( reserve_in_future ) %]
289
                                                    <li>
289
                                                    <li>
290
                                                        <label for="from[% bibitemloo.biblionumber | html %]">Hold starts on date:</label>
290
                                                        <label for="from[% bibitemloo.biblionumber | html %]">Hold starts on date:</label>
291
                                                        <input type="text" name="reserve_date_[% bibitemloo.biblionumber | html %]" id="from[% bibitemloo.biblionumber | html %]" data-start_for="to[% bibitemloo.biblionumber | html %]" data-flatpickr-futureinclusive="true" size="10" class="flatpickr holddatefrom" value="[% today | $raw %]" />
291
                                                        <input type="text" name="reserve_date_[% bibitemloo.biblionumber | html %]" id="from[% bibitemloo.biblionumber | html %]" data-start_for="to[% bibitemloo.biblionumber | html %]" data-flatpickr-futureinclusive="true" size="10" class="flatpickr holddatefrom" value="[% KohaDates.datetime_from_string | $KohaDates dateformat => 'iso' %]" />
292
                                                        <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber | html %]">[% INCLUDE 'date-format.inc' %]</span>
292
                                                        <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber | html %]">[% INCLUDE 'date-format.inc' %]</span>
293
                                                        <div class="required_label" style="display:none;">Required</div>
293
                                                        <div class="required_label" style="display:none;">Required</div>
294
                                                    </li>
294
                                                    </li>
(-)a/opac/opac-reserve.pl (-2 lines)
Lines 624-630 if ( C4::Context->preference('AllowHoldDateInFuture') Link Here
624
{
624
{
625
    $template->param(
625
    $template->param(
626
        reserve_in_future => 1,
626
        reserve_in_future => 1,
627
        today             => dt_from_string,
628
    );
627
    );
629
}
628
}
630
629
631
- 

Return to bug 35977