mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-31 03:34:18 +00:00
Use the new olson_from_tzstring() function to extract the Olson tz.
This commit is contained in:
parent
0ada660a8c
commit
e15c3d3b58
@ -49,15 +49,19 @@ class RepeatRuleTimeZone extends DateTimeZone {
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$original = $dtz;
|
||||
if ( preg_match( '{((([^/]+)/)?[^/]+)$}', $dtz, $matches ) ) {
|
||||
$dtz = $matches[1];
|
||||
dbg_error_log( 'RRule', 'Found timezone "%s", will process as "%s"', $original, $dtz );
|
||||
$dtz = olson_from_tzstring($dtz);
|
||||
if ( isset($dtz) ) {
|
||||
try {
|
||||
parent::__construct($dtz);
|
||||
$this->tzid = $dtz;
|
||||
}
|
||||
catch (Exception $e) {
|
||||
dbg_error_log( 'ERROR', 'Could not parse timezone "%s" - will use floating time', $original );
|
||||
$dtz = new DateTimeZone('UTC');
|
||||
$this->tzid = false;
|
||||
}
|
||||
}
|
||||
try {
|
||||
parent::__construct($dtz);
|
||||
$this->tzid = $dtz;
|
||||
}
|
||||
catch (Exception $e) {
|
||||
else {
|
||||
dbg_error_log( 'ERROR', 'Could not parse timezone "%s" - will use floating time', $original );
|
||||
$dtz = new DateTimeZone('UTC');
|
||||
$this->tzid = false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user