Another fix for negative hours.
authorNik Okuntseff <support@anuko.com>
Tue, 23 Apr 2019 18:04:07 +0000 (18:04 +0000)
committerNik Okuntseff <support@anuko.com>
Tue, 23 Apr 2019 18:04:07 +0000 (18:04 +0000)
WEB-INF/lib/ttTimeHelper.class.php
WEB-INF/lib/ttWeekViewHelper.class.php
WEB-INF/templates/footer.tpl

index 9ad64fc..08ffc46 100644 (file)
@@ -189,7 +189,7 @@ class ttTimeHelper {
   // toMinutes - converts a time string in format 00:00 to a number of minutes.
   static function toMinutes($value) {
     $signMultiplier = ttStartsWith($value, '-') ? -1 : 1;
-    if ($signMultiplier == -1) $duration = ltrim($duration, '-');
+    if ($signMultiplier == -1) $value = ltrim($value, '-');
 
     $time_a = explode(':', $value);
     return $signMultiplier * ((int)@$time_a[1] + ((int)@$time_a[0]) * 60);
index f7ad3f6..a790268 100644 (file)
@@ -354,7 +354,7 @@ class ttWeekViewHelper {
     }
     // Convert minutes to hh:mm for display.
     foreach($dayHeaders as $dayHeader) {
-      $dayTotals[$dayHeader] = ttTimeHelper::toAbsDuration($dayTotals[$dayHeader]);
+      $dayTotals[$dayHeader] = ttTimeHelper::minutesToDuration($dayTotals[$dayHeader]); // This breaks for negative hours.
     }
     return $dayTotals;
   }
index ac41b7c..5e5dd18 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.19.3.4979 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.19.3.4980 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>