diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc index fc8ce47aef..c5f290e800 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc @@ -136,28 +136,6 @@ } } - function Date_from_syspref(dstring) { - var dateX = dstring.split(/[-/.]/); - if (debug > 1 && sentmsg < 1) { - sentmsg++; - alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n")); - } - if (dateformat_pref === "iso") { - return new Date(dateX[0], (dateX[1] - 1), dateX[2]); // YYYY-MM-DD to (YYYY,m(0-11),d) - } else if (dateformat_pref === "us") { - return new Date(dateX[2], (dateX[0] - 1), dateX[1]); // MM/DD/YYYY to (YYYY,m(0-11),d) - } else if (dateformat_pref === "metric") { - return new Date(dateX[2], (dateX[1] - 1), dateX[0]); // DD/MM/YYYY to (YYYY,m(0-11),d) - } else if (dateformat_pref === "dmydot") { - return new Date(dateX[2], (dateX[1] - 1), dateX[0]); // DD.MM.YYYY to (YYYY,m(0-11),d) - } else { - if (debug > 0) { - alert("KOHA ERROR - Unrecognized date format: " + dateformat_pref); - } - return 0; - } - } - $(document).ready(function(){ $(".flatpickr").each(function(){ let options = {}; @@ -168,7 +146,7 @@ || $(this).data("flatpickr-futuredate") === true ) { let original_date = $(this).val(); if ( original_date ) { - original_date = Date_from_syspref( original_date ).getTime(); + original_date = flatpickr.parseDate(original_date, 'Y-m-d').getTime(); let tomorrow = new Date().fp_incr(1).getTime(); options['enable'] = [function(date){ diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt index 72f5e2e688..7009b3d830 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -287,7 +287,7 @@ [% IF ( reserve_in_future ) %]