diff --git a/main/session/session_edit.php b/main/session/session_edit.php index da400f64d5..97a0d8e654 100644 --- a/main/session/session_edit.php +++ b/main/session/session_edit.php @@ -25,13 +25,28 @@ SessionManager::protectSession($id); $sessionInfo = SessionManager::fetch($id); // Sets to local time to show it correctly when you edit a session +if (!empty($sessionInfo['display_start_date'])) { + $sessionInfo['display_start_date'] = api_get_local_time($sessionInfo['display_start_date']); +} +if (!empty($sessionInfo['display_end_date'])) { + $sessionInfo['display_end_date'] = api_get_local_time($sessionInfo['display_end_date']); +} -$sessionInfo['display_start_date'] = api_get_local_time($sessionInfo['display_start_date']); -$sessionInfo['display_end_date'] = api_get_local_time($sessionInfo['display_end_date']); -$sessionInfo['access_start_date'] = api_get_local_time($sessionInfo['access_start_date']); -$sessionInfo['access_end_date'] = api_get_local_time($sessionInfo['access_end_date']); -$sessionInfo['coach_access_start_date'] = api_get_local_time($sessionInfo['coach_access_start_date']); -$sessionInfo['coach_access_end_date'] = api_get_local_time($sessionInfo['coach_access_end_date']); +if (!empty($sessionInfo['access_start_date'])) { + $sessionInfo['access_start_date'] = api_get_local_time($sessionInfo['access_start_date']); +} + +if (!empty($sessionInfo['access_end_date'])) { + $sessionInfo['access_end_date'] = api_get_local_time($sessionInfo['access_end_date']); +} + +if (!empty($sessionInfo['coach_access_start_date'])) { + $sessionInfo['coach_access_start_date'] = api_get_local_time($sessionInfo['coach_access_start_date']); +} + +if (!empty($sessionInfo['coach_access_end_date'])) { + $sessionInfo['coach_access_end_date'] = api_get_local_time($sessionInfo['coach_access_end_date']); +} $id_coach = $sessionInfo['id_coach']; $tool_name = get_lang('EditSession');