Commit 6301cd03 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #430 in ZP/z-push from...

Merge pull request #430 in ZP/z-push from bugfix/ZP-1112-get-timezone-from-z-push-or-system to develop

* commit 'bbd75d07':
  ZP-1112 Add "W. Europe Standard Time" to the timezone list.
  ZP-1112 Get timezone from Z-Push or system if it's empty for getMSTZnameFromTZName.
parents 70e8b943 bbd75d07
...@@ -66,6 +66,7 @@ class TimezoneUtil { ...@@ -66,6 +66,7 @@ class TimezoneUtil {
"100" => array("Central European Standard Time", "(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb"), "100" => array("Central European Standard Time", "(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb"),
"105" => array("Romance Standard Time", "(GMT+01:00) Brussels, Copenhagen, Madrid, Paris"), "105" => array("Romance Standard Time", "(GMT+01:00) Brussels, Copenhagen, Madrid, Paris"),
"110" => array("W Europe Standard Time", "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"), "110" => array("W Europe Standard Time", "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"),
"111" => array("W. Europe Standard Time", "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"),
"113" => array("W Central Africa Standard Time", "(GMT+01:00) West Central Africa"), "113" => array("W Central Africa Standard Time", "(GMT+01:00) West Central Africa"),
"115" => array("E Europe Standard Time", "(GMT+02:00) Bucharest"), "115" => array("E Europe Standard Time", "(GMT+02:00) Bucharest"),
"120" => array("Egypt Standard Time", "(GMT+02:00) Cairo"), "120" => array("Egypt Standard Time", "(GMT+02:00) Cairo"),
...@@ -1209,6 +1210,12 @@ class TimezoneUtil { ...@@ -1209,6 +1210,12 @@ class TimezoneUtil {
* @return string * @return string
*/ */
static private function getMSTZnameFromTZName($name) { static private function getMSTZnameFromTZName($name) {
// if $name is empty, get the timezone from system
if (trim($name) == '') {
$name = date_default_timezone_get();
ZLog::Write(LOGLEVEL_INFO, sprintf("TimezoneUtil::getMSTZnameFromTZName(): empty timezone name sent. Got timezone from the system: '%s'", $name));
}
foreach (self::$mstzones as $mskey => $msdefs) { foreach (self::$mstzones as $mskey => $msdefs) {
if ($name == $msdefs[0]) if ($name == $msdefs[0])
return $msdefs[1]; return $msdefs[1];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment