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 <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Martin Renvoize 2024-02-19 10:31:19 +00:00 committed by Katrin Fischer
parent 03b95cc32a
commit fa745c3b1d
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 4 additions and 1 deletions

View File

@ -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 fp = $(input).flatpickr(options);

View File

@ -33,7 +33,7 @@
<li>
<div id="period_fields">
<label class="required" for="period">Booking dates: </label>
<input type="text" id="period" name="period" class="flatpickr" data-flatpickr-futuredate="true" required="required" disabled="true" autocomplete="off">
<input type="text" id="period" name="period" class="flatpickr" data-flatpickr-futuredate="true" data-flatpickr-disable-shortcuts="true" required="required" disabled="true" autocomplete="off">
<span class="required">Required</span>
</div>
<div class="hint">Select the booking start and end date</div>