Format timezone option groups

This commit is contained in:
nathan 2022-12-14 14:34:46 -07:00
parent 3b5f64a4c3
commit 8f7783e97c

View File

@ -41,7 +41,25 @@ class preferences_hooks
{
$langs = Api\Translation::get_installed_langs();
$tzs = Api\DateTime::getTimezones();
$tz_list = Api\DateTime::getTimezones();
// Format for select
$format = function ($key, $value) use (&$format, &$tzs)
{
if(is_array($value))
{
$value = [
'label' => $key,
'value' => array_map($format, array_keys($value), array_values($value))
];
}
else
{
$value = ['label' => $value, 'value' => $key];
}
return $value;
};
$tzs = array_map($format, array_keys($tz_list), array_values($tz_list));
}
$date_formats = array(