From 41a1806143665a82930e8c83bd05f5e695514748 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 19 Jul 2022 14:23:10 +0200 Subject: [PATCH] Bug 30718: Fix time display Especifically when timeformat=12h Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- .../intranet-tmpl/prog/en/includes/calendar.inc | 3 ++- .../prog/en/includes/checkouts-table-footer.inc | 4 ++-- .../prog/en/modules/circ/circulation.tt | 8 ++++---- .../intranet-tmpl/prog/en/modules/circ/offline.tt | 10 +--------- .../prog/en/modules/tools/holidays.tt | 14 +++++++------- .../prog/en/modules/tools/import_borrowers.tt | 7 ++++++- .../intranet-tmpl/prog/js/pages/circulation.js | 14 -------------- 7 files changed, 22 insertions(+), 38 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc index fee544a1dc..1f83d0ca58 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -157,7 +157,8 @@ } if ( $(this).data('flatpickr-enable-time') === true ) { options['enableTime'] = true; - options['dateFormat'] = flatpickr_dateformat_string + " " + flatpickr_timeformat_string; + options['dateFormat'] = "Y-m-d H:i"; + options['altFormat'] = flatpickr_dateformat_string + " " + flatpickr_timeformat_string; } let fp = $(this).flatpickr(options); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc index bede364104..c12c14a631 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc @@ -10,8 +10,8 @@ [% END %]
-

-

+

+

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 44614d73e8..e194dfc3d5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -317,7 +317,7 @@ [% IF ( INVALID_DATE ) %]

- +

[% ELSE %] @@ -680,9 +680,9 @@
Specify due date [% INCLUDE 'date-format.inc' %]:
[% IF ( duedatespec ) %] - + [% ELSE %] - + [% END %] [% IF ( stickyduedate ) %] @@ -747,7 +747,7 @@ [% IF noissues %]
- +
[% ELSE %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt index 3dd818a33d..efc2277f2f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt @@ -140,7 +140,7 @@
Specify due date [% INCLUDE 'date-format.inc' %]:
- + @@ -772,14 +772,6 @@ recordFine($('#pay-fine-amount').val()); }); - $("#duedatespec").flatpickr({ - enableTime: true, - dateFormat: flatpickr_datetime_string, - onClose: function() { - $("#checkout-barcode").focus(); - } - }); - $('#mainform').submit(function (event) { event.preventDefault(); var barcode = $('#checkout-barcode').val(); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt index a187980c43..86d581fb95 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt @@ -72,7 +72,7 @@
  • To date: - +
  • @@ -170,7 +170,7 @@
  • To date: - +
  • @@ -602,17 +602,17 @@ $(this).parent().find(".hint").toggle(); return false; }); - var dateofrange = $("#dateofrange").flatpickr(); - - var datecancelrange = $("#datecancelrange").flatpickr(); + const dateofrange = document.querySelector("#dateofrange")._flatpickr; + const datecancelrange = document.querySelector("#datecancelrange")._flatpickr; $("#dateofrange").each(function () { this.value = "" }); $("#datecancelrange").each(function () { this.value = "" }); var maincalendar = $("#calendar-anchor").flatpickr({ inline: true, - onReady: function(){ - return; + onReady: function( selectedDates, dateStr, instance ){ + // We do not want to display the 'close' icon in this case + $(instance.input).siblings('.flatpickr-input').hide(); }, onDayCreate: function( dObj, dStr, fp, dayElem ){ /* for each day on the calendar, get the diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt index 6603e78aa0..d553b6c647 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt @@ -418,7 +418,12 @@ you can supply dates in ISO format (e.g., '2010-10-28').