Explorar o código

Calendar localization test - more

causefx %!s(int64=7) %!d(string=hai) anos
pai
achega
b693432c6f
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      api/functions/homepage-connect-functions.php

+ 7 - 0
api/functions/homepage-connect-functions.php

@@ -1243,6 +1243,13 @@ function getCalendar()
 					if (!empty($startKeys) && !empty($endKeys) && isset($icsEvent['SUMMARY'])) {
 						/* Getting start date and time */
 						$repeat = isset($icsEvent ['RRULE']) ? $icsEvent ['RRULE'] : false;
+						if (!$originalTimeZone) {
+							$tzKey = array_keys($startKeys);
+							if (strpos($tzKey[0], 'TZID=') !== false) {
+								$originalTimeZone = explode('TZID=', (string)$tzKey[0]);
+								$originalTimeZone = (count($originalTimeZone) >= 2) ? $originalTimeZone[1] : false;
+							}
+						}
 						$start = reset($startKeys);
 						$end = reset($endKeys);
 						$totalDays = $GLOBALS['calendarStart'] + $GLOBALS['calendarEnd'];