Calendar: Fix import/export timezone preference had no options

This commit is contained in:
nathan 2023-05-16 11:28:08 -06:00
parent 6ecb2d8cf9
commit c3d961adbe

View File

@ -254,7 +254,25 @@ class calendar_hooks
// Timezone for file exports // Timezone for file exports
$export_tzs = array(['value' => '0', 'label' => lang('Use Event TZ')]); $export_tzs = array(['value' => '0', 'label' => lang('Use Event TZ')]);
$export_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;
};
$export_tzs = array_merge($export_tzs, array_map($format, array_keys($tz_list), array_values($tz_list)));
} }
$link_title_options = calendar_bo::get_link_options(); $link_title_options = calendar_bo::get_link_options();
$settings = array( $settings = array(