mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 21:38:54 +00:00
[feature/new-tz-handling] Fix handling of timezone and dst in dateformat_select
PHPBB3-9558
This commit is contained in:
parent
00b5e5345d
commit
09499fb128
1 changed files with 8 additions and 7 deletions
|
@ -906,11 +906,13 @@ class acp_board
|
||||||
global $user, $config;
|
global $user, $config;
|
||||||
|
|
||||||
// Let the format_date function operate with the acp values
|
// Let the format_date function operate with the acp values
|
||||||
$old_tz = $user->timezone;
|
$old_tz = $user->tz;
|
||||||
$old_dst = $user->dst;
|
if (is_numeric($config['board_timezone']))
|
||||||
|
{
|
||||||
$user->timezone = $config['board_timezone'] * 3600;
|
// Might still be numeric by chance
|
||||||
$user->dst = $config['board_dst'] * 3600;
|
$config['board_timezone'] = sprintf('Etc/GMT%+d', $config['board_timezone']);
|
||||||
|
}
|
||||||
|
$user->tz = new DateTimeZone($config['board_timezone']);
|
||||||
|
|
||||||
$dateformat_options = '';
|
$dateformat_options = '';
|
||||||
|
|
||||||
|
@ -929,8 +931,7 @@ class acp_board
|
||||||
$dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>';
|
$dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>';
|
||||||
|
|
||||||
// Reset users date options
|
// Reset users date options
|
||||||
$user->timezone = $old_tz;
|
$user->tz = $old_tz;
|
||||||
$user->dst = $old_dst;
|
|
||||||
|
|
||||||
return "<select name=\"dateoptions\" id=\"dateoptions\" onchange=\"if (this.value == 'custom') { document.getElementById('" . addslashes($key) . "').value = '" . addslashes($value) . "'; } else { document.getElementById('" . addslashes($key) . "').value = this.value; }\">$dateformat_options</select>
|
return "<select name=\"dateoptions\" id=\"dateoptions\" onchange=\"if (this.value == 'custom') { document.getElementById('" . addslashes($key) . "').value = '" . addslashes($value) . "'; } else { document.getElementById('" . addslashes($key) . "').value = this.value; }\">$dateformat_options</select>
|
||||||
<input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"30\" />";
|
<input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"30\" />";
|
||||||
|
|
Loading…
Add table
Reference in a new issue