packagist spatie/calendar-links 2.2.0

3 hours ago

Opt-in named timezones for ICS exports

Use $link->icsWithTimezones() to retain resolvable timezone names, including events whose endpoints share a zone, UTC and fixed-offset regions such as Asia/Tokyo. It accepts the same event and presentation options as ics():

$link->icsWithTimezones();
$link->icsWithTimezones(["RRULE" => "FREQ=WEEKLY"], ["format" => "file"]);

Existing ics() calls and the default Ics generator retain their 2.1 output. No migration or PHP requirement change is needed. Direct generator users can opt in with new Ics($options, $presentationOptions, withTimezones: true).

The opt-in method preserves exact instants when an endpoint falls in the second occurrence of a repeated local time by using UTC for both endpoints. Recurrences on that fallback repeat in UTC. When switching methods, review recurrence fields such as BYHOUR: they follow DTSTART’s timezone. All-day events remain date-only; unresolvable zones retain UTC fallback.

Includes regression coverage, Pest 4 / PHPUnit 12 development tooling, and a timezone-database-independent Morocco fixture. All six PHP 8.3–8.5 lowest/stable test jobs, Psalm, styling and the backward-compatibility check passed. Legacy compatibility was additionally checked against 1,280 exports from 2.1.0.

Thanks to @Prakashdahal2005 for the original contribution in #256.

Full changelog: 2.1.0...2.2.0

Don't miss a new calendar-links release

NewReleases is sending notifications on new releases.