From cabf2460445f26eded09e7d2c9c8cda97e8db593 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 23 Apr 2019 18:04:07 +0000 Subject: [PATCH] Another fix for negative hours. --- WEB-INF/lib/ttTimeHelper.class.php | 2 +- WEB-INF/lib/ttWeekViewHelper.class.php | 2 +- WEB-INF/templates/footer.tpl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index 9ad64fc4..08ffc46d 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -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); diff --git a/WEB-INF/lib/ttWeekViewHelper.class.php b/WEB-INF/lib/ttWeekViewHelper.class.php index f7ad3f6c..a790268b 100644 --- a/WEB-INF/lib/ttWeekViewHelper.class.php +++ b/WEB-INF/lib/ttWeekViewHelper.class.php @@ -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; } diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index ac41b7c6..5e5dd184 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.19.3.4979 | Copyright © Anuko | +  Anuko Time Tracker 1.19.3.4980 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1