From c28f1e0276bef100b88b4df0bd8f2a0d7d888314 Mon Sep 17 00:00:00 2001 From: Bart Visscher <bartv@thisnet.nl> Date: Thu, 6 Oct 2011 11:14:07 +0200 Subject: [PATCH] Implement timezone fix from Stephen Rees-Carter --- apps/calendar/templates/settings.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/apps/calendar/templates/settings.php b/apps/calendar/templates/settings.php index 19a1a543b4..913e54dd8f 100644 --- a/apps/calendar/templates/settings.php +++ b/apps/calendar/templates/settings.php @@ -16,16 +16,18 @@ OC_UTIL::addStyle('', 'jquery.multiselect'); <?php $continent = ''; foreach($_['timezones'] as $timezone): - if ( preg_match( '/^(America|Antartica|Arctic|Asia|Atlantic|Europe|Indian|Pacific)\//', $timezone ) ): - $ex=explode('/', $timezone, 2);//obtain continent,city - if ($continent!=$ex[0]): - if ($continent!="") echo '</optgroup>'; - echo '<optgroup label="'.$ex[0].'">'; - endif; - $city=$ex[1]; - $continent=$ex[0]; - echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>'; + $ex=explode('/', $timezone, 2);//obtain continent,city + if (!isset($ex[1])) { + $ex[1] = $ex[0]; + $ex[0] = "Other"; + } + if ($continent!=$ex[0]): + if ($continent!="") echo '</optgroup>'; + echo '<optgroup label="'.$ex[0].'">'; endif; + $city=$ex[1]; + $continent=$ex[0]; + echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>'; endforeach;?> </select></td></tr> -- GitLab