diff options
author | Philip Häusler <msquare@notrademark.de> | 2011-09-29 14:38:23 +0200 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2011-09-29 14:38:23 +0200 |
commit | 402dc172b65f5315458ab6ca4acf15fd2127c417 (patch) | |
tree | ef4997d128445e6fc091773bde3b6e6b725708d1 /includes/sys_shift.php | |
parent | 8a5f510da2fa2a0a4d543d436a8ca96df5d74301 (diff) |
fixed shift length display
Diffstat (limited to 'includes/sys_shift.php')
-rw-r--r-- | includes/sys_shift.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/includes/sys_shift.php b/includes/sys_shift.php index 7baeb8a4..329a40ff 100644 --- a/includes/sys_shift.php +++ b/includes/sys_shift.php @@ -1,4 +1,15 @@ <?php + + +/** + * Shiftlänge ausrechnen, kommt im Format 12:23h zurück + */ +function shift_length($shift) { + $length = round(($shift['end'] - $shift['start']) / (60 * 60), 0) . ":"; + $length .= str_pad((($shift['end'] - $shift['start']) % (60 * 60)) / 60, 2, "0", STR_PAD_LEFT) . "h"; + return $length; +} + function load_shift_basics() { global $VeranstaltungsTageMax, $Room, $RoomID, $EngelType, $EngelTypeID, $TID2Name, $Veranstaltungstage; |