CAT-47 Checkout receipt shows due date time for hourly checkouts
authorVictoria Lewis <vLewis@catalystdevworks.com>
Thu, 25 Feb 2016 17:05:33 +0000 (12:05 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
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 <vLewis@catalystdevworks.com>
modified:   Open-ILS/xul/staff_client/chrome/content/util/print.js

Open-ILS/xul/staff_client/chrome/content/util/print.js

index ee4dce8..1e4b7df 100644 (file)
@@ -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);}