From c59bb7874c99afd3969ba02c5a84c14a98849be4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 5 Aug 2022 11:10:42 +0200 Subject: [PATCH] Bug 30718: Apply flatpickr changes to OPAC Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc index 1ef4ffb611..17aafe7c13 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc @@ -52,8 +52,10 @@ flatpickr.l10ns.default.weekdays = flatpickr_weekdays; flatpickr.l10ns.default.months = flatpickr_months; flatpickr.setDefaults({ - allowInput: true, - dateFormat: flatpickr_dateformat_string, + dateFormat: "Y-m-d", + altInput: true, + altFormat: flatpickr_dateformat_string, + altInputClass: 'flatpickr-input', nextArrow: '', prevArrow: '', time_24hr: flatpickr_timeformat, @@ -68,7 +70,7 @@ if( $(instance.input).hasClass("pastdate") ){ instance.set("maxDate", new Date().fp_incr(-1)); } - $(instance.input) + $(instance.input).siblings('input.flatpickr') /* Add a wrapper element so that we can prevent the clear button from wrapping */ .wrap("") .after( $("") -- 2.39.5