1
0
Fork 0

Remove most calls to date_default_timezone_* calls

- It was wrongly used to set the node-wide ot user-specific timezone
- It is now fully managed from the App object
- Add a static variable to DateTimeFormat maintain the convenient local() method
This commit is contained in:
Hypolite Petovan 2021-10-03 12:38:47 -04:00
commit 6db211568a
11 changed files with 35 additions and 36 deletions

View file

@ -333,7 +333,7 @@ function settings_post(App $a)
}
if (($timezone != $user['timezone']) && strlen($timezone)) {
date_default_timezone_set($timezone);
$a->setTimeZone($timezone);
}
$aclFormatter = DI::aclFormatter();
@ -601,7 +601,7 @@ function settings_content(App $a)
$expire_network_only = DI::pConfig()->get(local_user(), 'expire', 'network_only', false);
if (!strlen($user['timezone'])) {
$timezone = date_default_timezone_get();
$timezone = $a->getTimeZone();
}
// Set the account type to "Community" when the page is a community page but the account type doesn't fit