mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
Merge pull request #2862 from marc1706/ticket/12932
[ticket/12932] Add method for allowing override of \phpbb\datetime class * marc1706/ticket/12932: [ticket/12932] Remove set_datetime_class method from user class [ticket/12932] Fix tests and calls to create_datetime [ticket/12932] Add method for getting the datetime class and allow overriding
This commit is contained in:
@@ -1061,7 +1061,7 @@ function phpbb_timezone_select($user, $default = '', $truncate = false)
|
||||
foreach ($unsorted_timezones as $timezone)
|
||||
{
|
||||
$tz = new DateTimeZone($timezone);
|
||||
$dt = new \phpbb\datetime($user, 'now', $tz);
|
||||
$dt = $user->create_datetime('now', $tz);
|
||||
$offset = $dt->getOffset();
|
||||
$current_time = $dt->format($user->lang['DATETIME_FORMAT'], true);
|
||||
$offset_string = phpbb_format_timezone_offset($offset);
|
||||
@@ -4881,7 +4881,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
|
||||
}
|
||||
}
|
||||
|
||||
$dt = new \phpbb\datetime($user, 'now', $user->timezone);
|
||||
$dt = $user->create_datetime();
|
||||
$timezone_offset = 'GMT' . phpbb_format_timezone_offset($dt->getOffset());
|
||||
$timezone_name = $user->timezone->getName();
|
||||
if (isset($user->lang['timezones'][$timezone_name]))
|
||||
|
Reference in New Issue
Block a user