From 559d64182588ecd95f5925e8b8a9646e56ae71bc Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 6 Sep 2020 23:27:00 +0200 Subject: [PATCH] User settings: Don't default to 1970-01-01 --- includes/pages/user_settings.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php index 46aea33d..35fe013c 100644 --- a/includes/pages/user_settings.php +++ b/includes/pages/user_settings.php @@ -45,7 +45,7 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes) $valid = false; } - if ($request->has('planned_arrival_date')) { + if ($request->has('planned_arrival_date') && $request->input('planned_arrival_date')) { $tmp = parse_date('Y-m-d H:i', $request->input('planned_arrival_date') . ' 00:00'); $result = User_validate_planned_arrival_date($tmp); $user_source->personalData->planned_arrival_date = Carbon::createFromTimestamp($result->getValue()); @@ -55,7 +55,7 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes) } } - if ($request->has('planned_departure_date')) { + if ($request->has('planned_departure_date') && $request->input('planned_departure_date')) { $tmp = parse_date('Y-m-d H:i', $request->input('planned_departure_date') . ' 00:00'); $plannedArrivalDate = $user_source->personalData->planned_arrival_date; $result = User_validate_planned_departure_date(