forked from sabre-io/vobject
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ren Xie Liu
committed
May 8, 2024
1 parent
a9edab8
commit e18f607
Showing
2 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -671,6 +671,49 @@ public function testCustomizedTimeZone(): void | |
self::assertSame(11 * 60 * 60, $tz->getOffset($start)); | ||
} | ||
|
||
public function testCustomizedTimeZone2(): void | ||
{ | ||
$ics = <<<ICS | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
PRODID:-//ical.marudot.com//iCal Event Maker | ||
X-WR-CALNAME:test | ||
NAME:test | ||
CALSCALE:GREGORIAN | ||
BEGIN:VTIMEZONE | ||
TZID:Customized Time Zone | ||
BEGIN:STANDARD | ||
DTSTART:16010101T030000 | ||
TZOFFSETFROM:+0200 | ||
TZOFFSETTO:+0100 | ||
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10 | ||
END:STANDARD | ||
BEGIN:DAYLIGHT | ||
DTSTART:16010101T020000 | ||
TZOFFSETFROM:+0100 | ||
TZOFFSETTO:+0200 | ||
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3 | ||
END:DAYLIGHT | ||
END:VTIMEZONE | ||
BEGIN:VEVENT | ||
DTSTAMP:20200907T032724Z | ||
UID:[email protected] | ||
DTSTART;TZID=Customized Time Zone:20210611T110000 | ||
DTEND;TZID=Customized Time Zone:20210611T113000 | ||
SUMMARY:customized time zone | ||
END:VEVENT | ||
END:VCALENDAR | ||
ICS; | ||
|
||
$tz = TimeZoneUtil::getTimeZone('Customized Time Zone', Reader::read($ics)); | ||
self::assertNotSame('Customized Time Zone', $tz->getName()); | ||
$start = new \DateTimeImmutable('2022-04-25'); | ||
self::assertSame(2 * 60 * 60, $tz->getOffset($start)); | ||
|
||
$start = new \DateTimeImmutable('2022-11-10'); | ||
self::assertSame(60 * 60, $tz->getOffset($start)); | ||
} | ||
|
||
public function testCustomizedTimeZoneWithoutDaylight(): void | ||
{ | ||
$ics = $this->getCustomizedICS(); | ||
|