}
// Convert minutes to hh:mm for display.
foreach($dayHeaders as $dayHeader) {
- $dayTotals[$dayHeader] = ttTimeHelper::minutesToDuration($dayTotals[$dayHeader]); // This breaks for negative hours.
+ $dayTotals[$dayHeader] = ttTimeHelper::minutesToDuration($dayTotals[$dayHeader]);
}
return $dayTotals;
}
}
// We do have start time.
- // Quick test if new duration is less then already existing.
$newMinutes = ttTimeHelper::toMinutes($new_duration);
+ if ($newMinutes < 0) {
+ // Negative durations are not supported when start time is defined.
+ $err->add($i18n->get('error.field'), $i18n->get('label.duration'));
+ return false;
+ }
+
+ // Quick test if new duration is less than already existing.
$oldMinutes = ttTimeHelper::toMinutes($oldDuration);
if ($newMinutes < $oldMinutes)
return true; // Safe to modify.
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.19.3.4980 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.19.3.4981 | Copyright © <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>