From c4039f72bb12684b0733281ade52696ed4019327 Mon Sep 17 00:00:00 2001 From: Robert Oehlmann Date: Mon, 3 Nov 2014 19:28:43 +0100 Subject: Fixed shift duration calculation Fixes issue #136 --- includes/view/Shifts_view.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'includes') diff --git a/includes/view/Shifts_view.php b/includes/view/Shifts_view.php index 824f519a..d0e7d809 100644 --- a/includes/view/Shifts_view.php +++ b/includes/view/Shifts_view.php @@ -4,8 +4,8 @@ * @param Shift $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"; return $length; } -?> \ No newline at end of file +?> -- cgit v1.2.3-54-g00ecf