summaryrefslogtreecommitdiff
path: root/includes/controller/shifts_controller.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-10-04 17:58:56 +0200
committermsquare <msquare@notrademark.de>2016-10-04 17:58:56 +0200
commit42144ed21cbc7361857b375d719ec53b24314546 (patch)
treeea8c80aa429e6bc1009a1372c3e4ddddf086932a /includes/controller/shifts_controller.php
parenteec10ebfc5c14ab9b72d3b81b7d44a2e507f5473 (diff)
move static access to datetime parse function
Diffstat (limited to 'includes/controller/shifts_controller.php')
-rw-r--r--includes/controller/shifts_controller.php8
1 files changed, 4 insertions, 4 deletions
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);