Add the Chronological

This commit is contained in:
2026-02-16 13:39:26 +01:00
parent c091ed1371
commit f1ac693fe8
162 changed files with 25868 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace Sabre\VObject\TimezoneGuesser;
use DateTimeZone;
use Sabre\VObject\Component\VTimeZone;
use Sabre\VObject\TimeZoneUtil;
/**
* Some clients add 'X-LIC-LOCATION' with the olson name.
*/
class GuessFromLicEntry implements TimezoneGuesser
{
public function guess(VTimeZone $vtimezone, bool $failIfUncertain = false): ?DateTimeZone
{
if (!isset($vtimezone->{'X-LIC-LOCATION'})) {
return null;
}
$lic = (string) $vtimezone->{'X-LIC-LOCATION'};
// Libical generators may specify strings like
// "SystemV/EST5EDT". For those we must remove the
// SystemV part.
if ('SystemV/' === substr($lic, 0, 8)) {
$lic = substr($lic, 8);
}
return TimeZoneUtil::getTimeZone($lic, null, $failIfUncertain);
}
}