From b958f05edf6f43f4d0a350e99e9a5cc95ca57659 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 19 Feb 2024 10:31:19 +0000 Subject: [PATCH] Bug 35532: Remove shortcut buttons from flatpickr It doesn't make sense to have the shortcut buttons in the range picker for bookings. This patch adds the ability to remove them entirely from display and uses that option in the bookings modal. Signed-off-by: David Nind Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer (cherry picked from commit fa745c3b1d13643e08cacd0cf3a0cb10d25fd8ec) Signed-off-by: Fridolin Somers --- koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 3 +++ .../intranet-tmpl/prog/en/includes/modals/place_booking.inc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc index e3de0dde7c..a3d213675c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -181,6 +181,9 @@ options['dateFormat'] = "Y-m-d H:i"; options['altFormat'] = flatpickr_dateformat_string + " " + flatpickr_timeformat_string; } + if ( $(input).data('flatpickr-disable-shortcuts') === true ) { + options['plugins'] = []; + } let maxDate = $(input).data("flatpickr-maxdate"); if( typeof maxDate !== 'undefined' ) { options['maxDate'] = new Date(maxDate); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/place_booking.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/place_booking.inc index 0ff2928750..c3dbfd6fdc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/place_booking.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/place_booking.inc @@ -33,7 +33,7 @@
  • - + Required
    Select the booking start and end date
    -- 2.39.5