From d73912dda28becc8f41d370237d0dd4e8cb792a3 Mon Sep 17 00:00:00 2001 From: Victoria Lewis Date: Thu, 25 Feb 2016 12:05:33 -0500 Subject: [PATCH] CAT-47 Checkout receipt shows due date time for hourly checkouts Due date time (hour and minute) shows on checkout receipts when the circulation duration for the checked out item is less than a day. Signed-off-by: Victoria Lewis modified: Open-ILS/xul/staff_client/chrome/content/util/print.js --- Open-ILS/xul/staff_client/chrome/content/util/print.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/print.js b/Open-ILS/xul/staff_client/chrome/content/util/print.js index ee4dce8d61..1e4b7df5fd 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/print.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/print.js @@ -526,6 +526,12 @@ util.print.prototype = { var s2 = new Date(s1); var s3 = util.date.formatted_date(s2, '%MMM %d, %Y'); + var new_date_today = new Date(Date.now()); + var one_day = (util.date.interval_to_seconds('1 day')*1000); + var diff_days = (s2 - new_date_today); + if (diff_days < one_day){ + s3 = util.date.formatted_date(s2, '%MMM %d, %Y %I:%M'); + } try{b = s; s=s.replace(re, this.escape_html(s3));} catch(E){s = b; this.error.standard_unexpected_error_alert('print.js, template_sub(): 2 string = <' + s + '>',E);} -- 2.11.0