Merge branch 'master' into wip_leon_T7841_replace_gmt_lists_with_timezone
[Pman.Core] / TimeZone.php
index 81e414c..4e2901f 100644 (file)
@@ -20,7 +20,7 @@ class Pman_Core_TimeZone extends Pman
 
         $data = array();
 
-        foreach(self::$tiemzones as $tz => $o) {
+        foreach(self::$timezones as $tz => $o) {
             if(!empty($_REQUEST['region']) && $_REQUEST['region'] != $o['region']) {
                 continue;
             }
@@ -34,6 +34,7 @@ class Pman_Core_TimeZone extends Pman
             }
             $data[] = array(
                 'region' => $o['region'],
+                'area' => $o['area'],
                 'displayArea' => $o['displayArea']
             );
         }
@@ -46,6 +47,7 @@ class Pman_Core_TimeZone extends Pman
                 'totalProperty' => 'total',
                 'fields' => array(
                     'region',
+                    'area',
                     'displayArea'
                 )
             ),
@@ -91,15 +93,17 @@ class Pman_Core_TimeZone extends Pman
                 continue;
             }
 
-            $displayOffset = '(GMT ' . (substr($ce->timeOffset, 0, 1) == '-') ? '' : '+' . $ce->timeOffset . ')';
+            $displayArea = str_replace('_', ' ', $ar[1]);
 
-            die($displayOffset);
+            $timeOffset = ((substr($ce->timeOffset, 0, 1) == '-') ? '' : '+') . $ce->timeOffset;
+            $displayOffset = '(GMT ' . $timeOffset . ')';
 
             self::$timezones[$ce->Name] = array(
                 'region' => $ar[0],
                 'area' => $ar[1],
-                'displayName' => $ce->Name . ' ' . $displayOffset,
-                'displayArea' => $ar[1] . ' ' . $displayOffset
+                'displayName' => $ar[0] . '/' . $displayArea . ' ' . $displayOffset,
+                'displayArea' => $displayArea . ' ' . $displayOffset,
+                'timeOffset' => $timeOffset
             );
         }