2012-06-18 10:20:15 +02:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2012-06-12 19:54:26 +02:00
|
|
|
function phpbb_switch_tz_date(keep_selection)
|
|
|
|
{
|
2012-06-17 16:54:12 +02:00
|
|
|
$('#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;
|
2012-06-12 19:54:26 +02:00
|
|
|
}
|
2012-06-17 16:54:12 +02:00
|
|
|
|
2012-06-12 19:54:26 +02:00
|
|
|
if (typeof keep_selection !== 'undefined')
|
|
|
|
{
|
|
|
|
if (!keep_selection)
|
|
|
|
{
|
2012-06-17 16:54:12 +02:00
|
|
|
$('#timezone > option:first').attr("selected", true);
|
2012-06-12 19:54:26 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-18 10:20:15 +02:00
|
|
|
/**
|
|
|
|
* Display the date/time select
|
|
|
|
*/
|
2012-06-12 19:54:26 +02:00
|
|
|
function phpbb_enable_tz_dates()
|
|
|
|
{
|
2012-06-17 16:54:12 +02:00
|
|
|
$('#tz_select_date').css("display", "block");
|
2012-06-12 19:54:26 +02:00
|
|
|
}
|
2012-06-17 16:54:12 +02:00
|
|
|
|
|
|
|
phpbb_enable_tz_dates();
|