diff --git a/src/RfcParser.php b/src/RfcParser.php index 1081de4..b0cf9f6 100755 --- a/src/RfcParser.php +++ b/src/RfcParser.php @@ -221,7 +221,7 @@ static public function parseRDate($line) foreach ($property['params'] as $name => $value) { switch (strtoupper($name)) { case 'TZID': - $tz = new \DateTimeZone($value); + $tz = self::parseTimeZone($value); break; case 'VALUE': switch ($value) { @@ -284,7 +284,7 @@ static public function parseExDate($line) // Ignore optional words break; case 'TZID': - $tz = new \DateTimeZone($value); + $tz = self::parseTimeZone($value); break; default: throw new \InvalidArgumentException("Unknown property parameter: $name"); @@ -325,4 +325,4 @@ static public function parseTimeZone($tzid) return new \DateTimeZone($tzid); } -} \ No newline at end of file +} diff --git a/tests/RfcParserTest.php b/tests/RfcParserTest.php index e39322c..87bebea 100755 --- a/tests/RfcParserTest.php +++ b/tests/RfcParserTest.php @@ -79,6 +79,9 @@ public function exdateLines() array('EXDATE;TZID=America/New_York:19970714T083000', array(date_create('19970714T083000',new \DateTimeZone('America/New_York'))) ), + array('EXDATE;TZID=W. Europe Standard Time:20230915T222222', + array(date_create('20230915T222222',new \DateTimeZone('Europe/Berlin'))) + ), ); } @@ -90,4 +93,4 @@ public function testParseExDate($string, $expected) $dates = RfcParser::parseExDate($string); $this->assertEquals($dates, $expected); } -} \ No newline at end of file +}