This commit is contained in:
Arsen Mirzaev Tatyano-Muradovich 2024-01-22 11:27:21 +07:00
parent f6d090f250
commit db9c99390e

View File

@ -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;