summaryrefslogtreecommitdiff
path: root/includes/pages/user_settings.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/pages/user_settings.php
parenteec10ebfc5c14ab9b72d3b81b7d44a2e507f5473 (diff)
move static access to datetime parse function
Diffstat (limited to 'includes/pages/user_settings.php')
-rw-r--r--includes/pages/user_settings.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php
index b2ea5752..22ead68b 100644
--- a/includes/pages/user_settings.php
+++ b/includes/pages/user_settings.php
@@ -56,16 +56,16 @@ function user_settings() {
$valid = false;
}
- if (isset($_REQUEST['planned_arrival_date']) && DateTime::createFromFormat("Y-m-d", trim($_REQUEST['planned_arrival_date']))) {
- $planned_arrival_date = DateTime::createFromFormat("Y-m-d", trim($_REQUEST['planned_arrival_date']))->getTimestamp();
+ if (isset($_REQUEST['planned_arrival_date']) && $tmp = parse_date("Y-m-d", $_REQUEST['planned_arrival_date'])) {
+ $planned_arrival_date = $tmp;
} else {
$valid = false;
$msg .= error(_("Please enter your planned date of arrival."), true);
}
if (isset($_REQUEST['planned_departure_date']) && $_REQUEST['planned_departure_date'] != '') {
- if (DateTime::createFromFormat("Y-m-d", trim($_REQUEST['planned_departure_date']))) {
- $planned_departure_date = DateTime::createFromFormat("Y-m-d", trim($_REQUEST['planned_departure_date']))->getTimestamp();
+ if ($tmp = parse_date("Y-m-d", $_REQUEST['planned_departure_date'])) {
+ $planned_departure_date = $tmp;
} else {
$valid = false;
$msg .= error(_("Please enter your planned date of departure."), true);