Don't show estimated wait for negative estimates
authorThomas Berezansky <tsbere@mvlc.org>
Tue, 17 Jan 2012 16:13:15 +0000 (11:13 -0500)
committerBill Erickson <berick@esilibrary.com>
Wed, 18 Jan 2012 20:05:17 +0000 (15:05 -0500)
JSPac code was just checking for the truth of the estimated_wait return,
but the estimated_wait return can be -1 under some circumstances.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/opac/skin/default/js/myopac.js

index 302f0ec..7f006d2 100644 (file)
@@ -461,7 +461,8 @@ function myOShowHoldStatus(r) {
 
        var row = $("myopac_holds_row_" + r.hold.id());
 
-    if(qstats.estimated_wait || myopacShowHoldEstimate) {
+    // A note: estimated_wait may be -1 under some circumstances where it shouldn't be shown.
+    if((qstats.estimated_wait && qstats.estimated_wait > 0) || myopacShowHoldEstimate) {
         myopacShowHoldEstimate = true;
         if(qstats.estimated_wait) {
             // wait is currently returned in seconds, but displayed in days