@@ -, +, @@
- Click "Synchronize."
- Click "Download records."
- Submit a card number for a patron who has multiple items checked out.
- In the table of previous checkouts, confirm that dates in the "Date
due" and "Checked out on" columns are formatted according to your
TimeFormat and DateFormat system preferences.
- When checking out to a patron with fines, open the fines tab and
submit an amount in payment. The table of payments should include a
correctly-formatted datetime.
- Test that the "Specify due date" date picker works correctly and that
checkouts show the correct date.
---
.../prog/en/modules/circ/offline.tt | 47 ++++++++++---------
1 file changed, 24 insertions(+), 23 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt
@@ -199,7 +199,7 @@
-
Amount
Timestamp
+
Amount
Date
@@ -260,6 +260,10 @@
var start;
var dateformat = '[% IF ( dateformat_us ) %]mm/dd/yy[% ELSIF ( dateformat_metric ) %]dd/mm/yy[% ELSE %]yy-mm-dd[% END %]';
+ var flatpickr_dateformat_string = [% IF ( dateformat == "us" ) %]"m/d/Y"[% ELSIF ( dateformat == "metric" ) %]"d/m/Y"[% ELSIF ( dateformat == "dmydot" ) %]"d.m.Y"[% ELSE %]"Y-m-d"[% END %];
+ var flatpickr_timeformat_string = [% IF Koha.Preference('TimeFormat') == '12hr' %]"G:i K"[% ELSE %]"H:i"[% END %];
+ var flatpickr_timestamp_string = "Y-m-d H:i";
+ var flatpickr_datetime_string = flatpickr_dateformat_string + " " + flatpickr_timeformat_string;
function checkin(barcode, item, error) {
var alerts = checkAlerts(barcode, item);
@@ -360,10 +364,15 @@
}
+ function fPformatTimeStamp( timestamp ){
+ var datetimeObj = flatpickr.parseDate( timestamp, flatpickr_timestamp_string );
+ return flatpickr.formatDate( datetimeObj, flatpickr_datetime_string );
+ }
+
function showTimestamp(key, value) {
if (typeof value !== 'undefined') {
var ts = new Date(value);
- $('#' + key).text($.datepicker.formatDate(dateformat, ts) + ' ' + ts.toTimeString());
+ $('#' + key).text( fPformatTimeStamp( ts ) + ' ' + ts.toTimeString());
} else {
$('#' + key).text(_("(never)"));
}
@@ -473,7 +482,7 @@
$('#oldissuest tbody').empty();
issuesidx.each(function (item) {
$('#oldissues').show();
- $('#oldissuest tbody').append("
" + item.value.date_due + "
" + item.value.title + "
" + item.value.barcode + "
" + item.value.itype + "
" + item.value.issuedate + "
" + item.value.issuebranch + "
" + item.value.callnumber + "
" + "" + "
");
+ $('#oldissuest tbody').append("
" + fPformatTimeStamp( item.value.date_due ) + "
" + item.value.title + "
" + item.value.barcode + "
" + item.value.itype + "
" + fPformatTimeStamp( item.value.issuedate ) + "
" + item.value.issuebranch + "
" + item.value.callnumber + "
" + "" + "
");
$('.checkout-count').text(parseInt($('.checkout-count').text()) + 1);
}, barcode);
});
@@ -495,7 +504,7 @@
setTimeout(function() { $('#duedatespec').trigger('focus'), 1 });
return;
}
- var date_due = new Date($('#duedatespec').datepicker('getDate'));
+ var date_due = flatpickr.parseDate( $('#duedatespec').val(), flatpickr_datetime_string );
var trans = { "timestamp" : new Date().toMySQLString(),
"barcode" : barcode,
"cardnumber" : curpatron.cardnumber,
@@ -505,7 +514,7 @@
$('#alerts').empty();
kohadb.recordTransaction(trans, function () {
$('#session-issues').show();
- $('#issuest tbody').prepend('