From 42144ed21cbc7361857b375d719ec53b24314546 Mon Sep 17 00:00:00 2001 From: msquare Date: Tue, 4 Oct 2016 17:58:56 +0200 Subject: move static access to datetime parse function --- includes/controller/shifts_controller.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'includes/controller/shifts_controller.php') diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php index 3300c0d2..ca6fd906 100644 --- a/includes/controller/shifts_controller.php +++ b/includes/controller/shifts_controller.php @@ -69,15 +69,15 @@ function shift_edit_controller() { $msg .= error(_('Please select a shifttype.'), true); } - 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; $msg .= error(_("Please enter a valid starting time for the shifts."), true); } - 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; $msg .= error(_("Please enter a valid ending time for the shifts."), true); -- cgit v1.2.3-54-g00ecf