aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/adm/style/timezone.js
blob: d1667699da1344356ce612bb363878cc46140df8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* Hide the optgroups that are not the selected timezone
*
* @param	bool	keep_selection		Shall we keep the value selected, or shall the user be forced to repick one.
*/
function phpbb_switch_tz_date(keep_selection)
{
	$('#timezone > optgroup').css("display", "none");
	$("#timezone > optgroup[label='" + $('#tz_date').val() + "']").css("display", "block");

	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);
		keep_selection = true;
	}

	if (typeof keep_selection !== 'undefined')
	{
		if (!keep_selection)
		{
			$('#timezone > option:first').attr("selected", true);
		}
	}
}

/**
* Display the date/time select
*/
function phpbb_enable_tz_dates()
{
	$('#tz_select_date').css("display", "block");
}

phpbb_enable_tz_dates();