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) {
|
catch (Exception $e) {
|
||||||
$original = $dtz;
|
$original = $dtz;
|
||||||
if ( preg_match( '{((([^/]+)/)?[^/]+)$}', $dtz, $matches ) ) {
|
$dtz = olson_from_tzstring($dtz);
|
||||||
$dtz = $matches[1];
|
if ( isset($dtz) ) {
|
||||||
dbg_error_log( 'RRule', 'Found timezone "%s", will process as "%s"', $original, $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 {
|
else {
|
||||||
parent::__construct($dtz);
|
|
||||||
$this->tzid = $dtz;
|
|
||||||
}
|
|
||||||
catch (Exception $e) {
|
|
||||||
dbg_error_log( 'ERROR', 'Could not parse timezone "%s" - will use floating time', $original );
|
dbg_error_log( 'ERROR', 'Could not parse timezone "%s" - will use floating time', $original );
|
||||||
$dtz = new DateTimeZone('UTC');
|
$dtz = new DateTimeZone('UTC');
|
||||||
$this->tzid = false;
|
$this->tzid = false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user