diff options
author | Mario <mario@mariovavti.com> | 2022-02-11 09:23:29 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-02-11 09:23:29 +0000 |
commit | 5468de2c6ad5187cd51201cda929c3e54cc2938f (patch) | |
tree | 3520a10665bd2956c6a032c508f63019fed19307 /vendor/sabre/vobject/lib/TimezoneGuesser/GuessFromLicEntry.php | |
parent | 6d8aabab2347feabdd804b609dcd4513f09f78d4 (diff) | |
download | volse-hubzilla-5468de2c6ad5187cd51201cda929c3e54cc2938f.tar.gz volse-hubzilla-5468de2c6ad5187cd51201cda929c3e54cc2938f.tar.bz2 volse-hubzilla-5468de2c6ad5187cd51201cda929c3e54cc2938f.zip |
composer libs minor version updates add new files
Diffstat (limited to 'vendor/sabre/vobject/lib/TimezoneGuesser/GuessFromLicEntry.php')
-rw-r--r-- | vendor/sabre/vobject/lib/TimezoneGuesser/GuessFromLicEntry.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/vendor/sabre/vobject/lib/TimezoneGuesser/GuessFromLicEntry.php b/vendor/sabre/vobject/lib/TimezoneGuesser/GuessFromLicEntry.php new file mode 100644 index 000000000..f340a3962 --- /dev/null +++ b/vendor/sabre/vobject/lib/TimezoneGuesser/GuessFromLicEntry.php @@ -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); + } +} |