Skip to content

Commit

Permalink
[Calendar] Support UTC-05:00 timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
Ren Xie Liu committed Feb 11, 2022
1 parent 2013799 commit a72edf0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/timezonedata/extrazones.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
'UTC-09' => 'Pacific/Gambier',
'UTC-11' => 'Pacific/Niue',
'UTC+12' => 'Pacific/Auckland',
'UTC-05:00' => 'America/Lima',
'US Eastern Standard Time' => 'America/New_York',
'tzone://Microsoft/Utc' => 'UTC',
'America/Santa_Isabel' => 'America/Tijuana',
Expand Down
18 changes: 18 additions & 0 deletions tests/VObject/TimeZoneUtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,4 +445,22 @@ public function unSupportTimezoneProvider(): iterable
fclose($handle);
}
}

/**
* @dataProvider offsetTimeZoneProvider
*/
public function testOffsetTimeZones(string $origin, string $expected)
{
$tz = TimeZoneUtil::getTimeZone($origin, null, true);
$ex = new \DateTimeZone($expected);
$this->assertEquals($ex->getName(), $tz->getName());
}

public function offsetTimeZoneProvider(): iterable
{
yield 'UTC-05:00' => [
'origin' => 'UTC-05:00',
'expected' => 'America/Lima',
];
}
}

0 comments on commit a72edf0

Please sign in to comment.