Skip to content

Commit ed9b690

Browse files
authored
Merge pull request #8882 from jdarwood007/3.0/feature7646
[3.0] Show Other for time format when customized
2 parents 07ba880 + 8978c50 commit ed9b690

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Languages/en_US/General.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@
351351
$txt['are_sure_remove_topic'] = 'Are you sure you want to remove this topic?';
352352
$txt['yes'] = 'Yes';
353353
$txt['no'] = 'No';
354+
$txt['other'] = 'Other';
354355

355356
$txt['search_end_results'] = 'End of results';
356357
$txt['search_on'] = 'on';

Themes/default/Profile.template.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3110,13 +3110,18 @@ function template_profile_timeformat_modify()
31103110
<select name="easyformat" id="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;">';
31113111

31123112
// Help the user by showing a list of common time formats.
3113-
foreach (Utils::$context['easy_timeformats'] as $time_format)
3113+
$found = false;
3114+
foreach (Utils::$context['easy_timeformats'] as $time_format) {
3115+
$found = $found || $time_format['format'] == Utils::$context['member']['time_format'];
3116+
31143117
echo '
31153118
<option value="', $time_format['format'], '"', $time_format['format'] == Utils::$context['member']['time_format'] ? ' selected' : '', '>', $time_format['title'], '</option>';
3119+
}
31163120

31173121
echo '
3122+
<option value="other"', !$found ? ' selected' : '', ' disabled>', Lang::getTxt('other', file: 'General'), '</option>
31183123
</select>
3119-
<input type="text" name="time_format" id="time_format" value="', Utils::$context['member']['time_format'], '" size="30">
3124+
<input type="text" name="time_format" id="time_format" value="', Utils::$context['member']['time_format'], '" onchange="document.forms.creator.easyformat.value = \'other\'" size="30">
31203125
</dd>';
31213126
}
31223127

0 commit comments

Comments
 (0)