Browse Source

Bug 30718: Fix time display

Especifically when timeformat=12h

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22.11.x
Jonathan Druart 2 years ago
committed by Tomas Cohen Arazi
parent
commit
41a1806143
Signed by: tomascohen GPG Key ID: 0A272EA1B2F3C15F
  1. 3
      koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc
  2. 4
      koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc
  3. 8
      koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
  4. 10
      koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt
  5. 14
      koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt
  6. 7
      koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt
  7. 14
      koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js

3
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);

4
koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc

@ -10,8 +10,8 @@
<td colspan="3">
[% END %]
<div class="date-select">
<p><label for="newduedate">Renewal due date:</label> <input type="text" size="20" id="newduedate" name="newduedate" value="" /></p>
<p id="newonholdduedate"><label for="newonholdduedate">On hold due date:</label> <input type="text" size="20" name="newonholdduedate" value="" /></p>
<p><label for="newduedate">Renewal due date:</label> <input type="text" size="20" id="newduedate" name="newduedate" value="" class="flatpickr" data-flatpickr-enable-time="true"/></p>
<p id="newonholdduedate"><label for="newonholdduedate">On hold due date:</label> <input type="text" size="20" name="newonholdduedate" value="" class="flatpickr" data-flatpickr-enable-time="true" /></p>
<p><label for="exemptfine">Forgive fines on return:</label> <input type="checkbox" id="exemptfine" name="exemptfine" value="1" /></p>
</div>
</td>

8
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

@ -317,7 +317,7 @@
[% IF ( INVALID_DATE ) %]
<p>
<input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | $KohaDates with_hours => 1 %]" />
<input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
<label for="duedatespec">Due date</label>
</p>
[% ELSE %]
@ -680,9 +680,9 @@
<div id="specify-due-date" class="circ-setting">
<div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
[% IF ( duedatespec ) %]
<input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" />
<input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
[% ELSE %]
<input type="text" size="20" id="duedatespec" name="duedatespec" value="" />
<input type="text" size="20" id="duedatespec" name="duedatespec" value="" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
[% END %]
<label for="stickyduedate"> Remember for session:</label>
[% IF ( stickyduedate ) %]
@ -747,7 +747,7 @@
[% IF noissues %]
<div class="onsite-checkout-only">
<input type="checkbox" id="onsite_checkout" name="onsite_checkout_forced" checked="checked" disabled="disabled" /> <label for="onsite_checkout">On-site checkouts only. Automatic due date: </label>
<input type="text" name="duedatespec" id="duedatespec" />
<input type="text" name="duedatespec" id="duedatespec" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
<input type="hidden" name="onsite_checkout" checked="checked" value="1" />
</div>
[% ELSE %]

10
koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt

@ -140,7 +140,7 @@
<div class="date-select">
<div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
<input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" />
<input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#checkout-barcode" />
<label for="stickyduedate"> Remember for session:</label>
<input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" checked="checked" />
<input type="button" class="action" id="cleardate" value="Clear" name="cleardate" onclick="this.checked = false; this.form.duedatespec.value = ''; this.form.stickyduedate.checked = false; this.form.barcode.focus(); return false;" />
@ -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();

14
koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt

@ -72,7 +72,7 @@
</li>
<li class="dateinsert">
<strong>To date: </strong>
<input type="text" id="datecancelrange" name="datecancelrange" size="20" value="[% datecancelrange | html %]" />
<input type="text" id="datecancelrange" name="datecancelrange" size="20" value="[% datecancelrange | html %]" class="flatpickr" />
</li>
<li>
<label for="showTitle">Title: </label><input type="text" name="showTitle" id="showTitle" size="35" />
@ -170,7 +170,7 @@
</li>
<li class="dateinsert">
<strong>To date: </strong>
<input type="text" id="dateofrange" name="dateofrange" size="20" value="[% dateofrange | html %]" />
<input type="text" id="dateofrange" name="dateofrange" size="20" value="[% dateofrange | html %]" class="flatpickr" />
</li>
<li>
<label for="title">Title: </label>
@ -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

7
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').
<script>
$(document).ready(function() {
[%# Make date fields have the datepicker %]
$("#dateenrolled, #dateexpiry, #dateofbirth").flatpickr();
$("#dateenrolled, #dateexpiry, #dateofbirth").flatpickr({
altInput: true,
altFormat: flatpickr_dateformat_string,
altInputClass: 'flatpickr-input',
dateFormat: "Y-m-d",
});
$(".expand_defaults").click(function(e){
e.preventDefault();

14
koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js

@ -1,4 +1,3 @@
/* global flatpickr_dateformat_string flatpickr_timeformat_string */
$(document).ready(function() {
$("#CheckAllExports").on("click",function(){
$(".export:visible").prop("checked", true);
@ -29,19 +28,6 @@ $(document).ready(function() {
radioCheckBox($(this));
});
$("#duedatespec").flatpickr({
enableTime: true,
dateFormat: flatpickr_dateformat_string + " " + flatpickr_timeformat_string,
onClose: function() {
$("#barcode").focus();
}
});
$("#newduedate, #newonholdduedate input").flatpickr({
enableTime: true,
dateFormat: flatpickr_dateformat_string + " " + flatpickr_timeformat_string,
});
$(".clear_date").on("click", function(){
$("#stickyduedate").prop( "checked", false );
});

Loading…
Cancel
Save