Fixed shift duration calculation

Fixes issue #136
This commit is contained in:
Robert Oehlmann 2014-11-03 19:28:43 +01:00
parent b221b362dc
commit c4039f72bb
1 changed files with 2 additions and 2 deletions

View File

@ -4,8 +4,8 @@
* @param Shift $shift * @param Shift $shift
*/ */
function shift_length($shift) { function shift_length($shift) {
$length = round(($shift['end'] - $shift['start']) / (60 * 60), 0) . ":"; $length = floor(($shift['end'] - $shift['start']) / (60 * 60)) . ":";
$length .= str_pad((($shift['end'] - $shift['start']) % (60 * 60)) / 60, 2, "0", STR_PAD_LEFT) . "h"; $length .= str_pad((($shift['end'] - $shift['start']) % (60 * 60)) / 60, 2, "0", STR_PAD_LEFT) . "h";
return $length; return $length;
} }
?> ?>