From db9c99390e69a4e1f5dae26515e60a46d6955698 Mon Sep 17 00:00:00 2001 From: Arsen Mirzaev Tatyano-Muradovich Date: Mon, 22 Jan 2024 11:27:21 +0700 Subject: [PATCH] fix #50 fix #51 --- mirzaev/ebala/system/controllers/task.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mirzaev/ebala/system/controllers/task.php b/mirzaev/ebala/system/controllers/task.php index 065e38c..580ad44 100755 --- a/mirzaev/ebala/system/controllers/task.php +++ b/mirzaev/ebala/system/controllers/task.php @@ -443,7 +443,8 @@ final class task extends core $link->task['start'] instanceof datetime && $link->task['end'] instanceof datetime ) { - $generated['hours'] = (float) $link->task['end']->diff($link->task['start'])->format('%H.%i'); + $generated['hours'] = (float) $link->task['start']->diff($link->task['end'])->format('%R%H.%i'); + if ($generated['hours'] < 0) $generated['hours'] += 24; if ($generated['hours'] >= 6.5 && $generated['hours'] < 9) $generated['hours'] -= 0.5; else if ($generated['hours'] >= 9 && $generated['hours'] < 12.5) $generated['hours'] -= 1; else if ($generated['hours'] >= 12.5) $generated['hours'] -= 1.5;