diff options
author | msquare <msquare@notrademark.de> | 2016-11-09 17:43:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-09 17:43:56 +0100 |
commit | d43eb41d25d0d5c0509417247030dd6c21118cf6 (patch) | |
tree | 2c3f78bf8fbd4215e70af7dbc2ce30cfef674816 /includes/pages/admin_shifts.php | |
parent | d5d2acc7d80920eef5f0ed779a3738a12d5db348 (diff) | |
parent | 22520532c78b3a032aec6ececb7623ba094da8de (diff) |
Merge pull request #274 from engelsystem/task-164-shift-view
Task 164 shift view
Diffstat (limited to 'includes/pages/admin_shifts.php')
-rw-r--r-- | includes/pages/admin_shifts.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/includes/pages/admin_shifts.php b/includes/pages/admin_shifts.php index 3dd22f3a..42a8c682 100644 --- a/includes/pages/admin_shifts.php +++ b/includes/pages/admin_shifts.php @@ -9,7 +9,7 @@ function admin_shifts() { $valid = true; $rid = 0; - $start = DateTime::createFromFormat("Y-m-d H:i", date("Y-m-d") . " 00:00")->getTimestamp(); + $start = parse_date("Y-m-d H:i", date("Y-m-d") . " 00:00"); $end = $start; $mode = 'single'; $angelmode = 'manually'; @@ -71,15 +71,15 @@ function admin_shifts() { error(_('Please select a location.')); } - if (isset($_REQUEST['start']) && $tmp = DateTime::createFromFormat("Y-m-d H:i", trim($_REQUEST['start']))) { - $start = $tmp->getTimestamp(); + if (isset($_REQUEST['start']) && $tmp = parse_date("Y-m-d H:i", $_REQUEST['start'])) { + $start = $tmp; } else { $valid = false; error(_('Please select a start time.')); } - if (isset($_REQUEST['end']) && $tmp = DateTime::createFromFormat("Y-m-d H:i", trim($_REQUEST['end']))) { - $end = $tmp->getTimestamp(); + if (isset($_REQUEST['end']) && $tmp = parse_date("Y-m-d H:i", $_REQUEST['end'])) { + $end = $tmp; } else { $valid = false; error(_('Please select an end time.')); @@ -188,7 +188,7 @@ function admin_shifts() { } while ($shift_end < $end); } elseif ($mode == 'variable') { rsort($change_hours); - $day = DateTime::createFromFormat("Y-m-d H:i", date("Y-m-d", $start) . " 00:00")->getTimestamp(); + $day = parse_date("Y-m-d H:i", date("Y-m-d", $start) . " 00:00"); $change_index = 0; // Ersten/nächsten passenden Schichtwechsel suchen foreach ($change_hours as $i => $change_hour) { @@ -205,7 +205,7 @@ function admin_shifts() { $shift_start = $start; do { - $day = DateTime::createFromFormat("Y-m-d H:i", date("Y-m-d", $shift_start) . " 00:00")->getTimestamp(); + $day = parse_date("Y-m-d H:i", date("Y-m-d", $shift_start) . " 00:00"); $shift_end = $day + $change_hours[$change_index] * 60 * 60; if ($shift_end > $end) { |