mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-07 16:15:22 +02:00
[feature/new-tz-handling] Display suggestion when a different value is selected
PHPBB3-9558
This commit is contained in:
parent
81627e2888
commit
d099ef8cad
@ -420,6 +420,12 @@ phpbb.timezone_switch_date = function(keep_selection) {
|
||||
$('#timezone > optgroup').css('display', 'none');
|
||||
$("#timezone > optgroup[label='" + $('#tz_date').val() + "']").css('display', 'block');
|
||||
|
||||
if ($('#tz_date').val() == $('#tz_select_date_suggest').attr('data-suggested-tz')) {
|
||||
$('#tz_select_date_suggest').css('display', 'none');
|
||||
} else {
|
||||
$('#tz_select_date_suggest').css('display', 'inline');
|
||||
}
|
||||
|
||||
if ($("#timezone > optgroup[label='" + $('#tz_date').val() + "'] > option").size() == 1) {
|
||||
// If there is only one timezone for the selected date, we just select that automatically.
|
||||
$("#timezone > optgroup[label='" + $('#tz_date').val() + "'] > option:first").attr('selected', true);
|
||||
@ -485,10 +491,12 @@ phpbb.timezone_preselect_select = function(force_selector) {
|
||||
$('#tz_select_date_suggest').css('display', 'inline');
|
||||
$('#tz_select_date_suggest').attr('title', $('#tz_select_date_suggest').attr('data-l-suggestion').replace("%s", option.innerHTML));
|
||||
$('#tz_select_date_suggest').attr('value', $('#tz_select_date_suggest').attr('data-l-suggestion').replace("%s", option.innerHTML.substring(0, 9)));
|
||||
$('#tz_select_date_suggest').attr('data-suggested-tz', option.innerHTML);
|
||||
phpbb.timezone_switch_date(true);
|
||||
} else {
|
||||
option.selected = true;
|
||||
phpbb.timezone_switch_date(!force_selector);
|
||||
$('#tz_select_date_suggest').attr('data-suggested-tz', option.innerHTML);
|
||||
$('#tz_select_date_suggest').css('display', 'none');
|
||||
}
|
||||
break;
|
||||
|
@ -1207,7 +1207,7 @@ function phpbb_timezone_select($default = '', $truncate = false)
|
||||
$opt_group = $timezone['offest'];
|
||||
|
||||
$selected = ($default_offset == $timezone['offest']) ? ' selected="selected"' : '';
|
||||
$tz_dates .= '<option value="' . $timezone['offest'] . ' - ' . $timezone['current'] . '"' . $selected . '>' . $timezone['offest'] . ' - ' . $timezone['current'] . '</option>';
|
||||
$tz_dates .= '<option value="' . $timezone['offest'] . ' - ' . $timezone['current'] . '"' . $selected . '>' . $timezone['offest'] . ' - ' . $timezone['current'] . ($selected ? ' ' . $user->lang['TIMEZONE_SELECTED'] : '') . '</option>';
|
||||
}
|
||||
|
||||
if (isset($user->lang['timezones'][$timezone['tz']]))
|
||||
@ -1229,7 +1229,7 @@ function phpbb_timezone_select($default = '', $truncate = false)
|
||||
}
|
||||
|
||||
$selected = ($timezone['tz'] === $default) ? ' selected="selected"' : '';
|
||||
$tz_select .= '<option title="' . $title . '" value="' . $timezone['tz'] . '"' . $selected . '>' . $label . '</option>';
|
||||
$tz_select .= '<option title="' . $title . '" value="' . $timezone['tz'] . '"' . $selected . '>' . $label . ($selected ? ' ' . $user->lang['TIMEZONE_SELECTED'] : '') . '</option>';
|
||||
}
|
||||
$tz_select .= '</optgroup>';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user