Skip to content

Commit e2b984e

Browse files
committed
fix: wrong timezone in android calendar
The tzname and tznamedst in timezone blob confuses some android devices, so that they fallback to Greenwich Mean Time timezone even though the other data in timezone blob contains the correct information of the selected timezone (e.g. Central European Standard Time). Setting tzname and tznamedst to empty strings mitigates this issue.
1 parent 9aa611d commit e2b984e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/utils/timezoneutil.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,7 @@ private static function encodeTZName($name) {
12751275
*/
12761276
public static function GetSyncBlobFromTZ($tz) {
12771277
// set the correct TZ name (done using the Bias)
1278-
if (!isset($tz["tzname"]) || !$tz["tzname"] || !isset($tz["tznamedst"]) || !$tz["tznamedst"]) {
1278+
if (!isset($tz["tzname"]) || !isset($tz["tznamedst"])) {
12791279
$tz = TimezoneUtil::FillTZNames($tz);
12801280
}
12811281

@@ -1452,11 +1452,10 @@ public static function CreateTimezoneDefinitionObject($tzdef) {
14521452
* @return array
14531453
*/
14541454
public static function GetTzFromTimezoneDef($tzdef) {
1455-
$tz = [];
1456-
// convert timezone name because in zcore the chars are nul-padded
1457-
if (!empty($tzdef['keyname'])) {
1458-
$tz['tzname'] = $tz['tznamedst'] = self::getMSTZnameFromTZName(iconv('UTF-16', 'UTF-8', $tzdef['keyname']));
1459-
}
1455+
$tz = [
1456+
'tzname' => '',
1457+
'tznamedst' => '',
1458+
];
14601459

14611460
foreach ($tzdef['rules'] as $rule) {
14621461
if ($rule['tzruleflags'] & TZRULE_FLAG_EFFECTIVE_TZREG) {

0 commit comments

Comments
 (0)