Revision: 2637
          https://sourceforge.net/p/mrbs/code/2637/
Author:   cimorrison
Date:     2013-01-08 14:55:46 +0000 (Tue, 08 Jan 2013)
Log Message:
-----------
Fixed bug preventing singular form of the duration units being shown

Modified Paths:
--------------
    mrbs/trunk/web/js/edit_entry.js.php

Modified: mrbs/trunk/web/js/edit_entry.js.php
===================================================================
--- mrbs/trunk/web/js/edit_entry.js.php 2013-01-08 14:34:10 UTC (rev 2636)
+++ mrbs/trunk/web/js/edit_entry.js.php 2013-01-08 14:55:46 UTC (rev 2637)
@@ -682,21 +682,25 @@
       duration = durFormat(duration/60);
     }
   }
-    
+  
+  <?php
+  // duration can be either a number or a string from now on
+  // (durFormat returns a string), so we use == and not ===
+  ?>
   if (days !== 0)
   {
     text += days + ' ';
     text += (days === 1) ? vocab.days.singular : vocab.days.plural;
-    if (duration !== 0)
+    if (duration != 0)
     {
       text +=  ', ';
     }
   }
 
-  if (duration !== 0)
+  if (duration != 0)
   {
     text += duration + ' ';
-    text += (duration === 1) ? vocab[durUnits].singular : 
vocab[durUnits].plural;
+    text += (duration == 1) ? vocab[durUnits].singular : 
vocab[durUnits].plural;
   }
   return text;
 }
------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to