ical files missing "VTIMEZONE" component
Overview
CiviEvent ical files are generated without the "VTIMEZONE" component which means in some time zones the event date and time will be incorrect with some calendar clients.
Specifically I have two Drupal/CiviCRM websites in Alberta that use America/Edmonton as their timezone settings. Several CiviEvents towards the end of September and the month of October generate iCal files that are off by an hour for Microsoft Outlook Calendars set for the Alberta Canada time zone. Apple Calendars and Google Calendars set for Alberta time render the iCal files correctly. If we add markup for "VTIMEZONE" in the iCal file, they work correctly for Microsoft Outlook Calendars set for the Alberta Canada time zone.
I've added the following static markup to the iCal files to get them to behave correctly in Microsoft Outlook Calendar set to the Alberta Time Zone.
BEGIN:VTIMEZONE
TZID:America/Edmonton
LAST-MODIFIED:20220816T024022Z
TZURL:https://static.tzurl.org/zoneinfo-outlook/America/Edmonton.ics
X-LIC-LOCATION:America/Edmonton
BEGIN:DAYLIGHT
TZNAME:MDT
TZOFFSETFROM:-0700
TZOFFSETTO:-0600
DTSTART:19700308T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MST
TZOFFSETFROM:-0600
TZOFFSETTO:-0700
DTSTART:19701101T020000
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
END:STANDARD
END:VTIMEZONE
The "VTIMEZONE" component is described here: https://icalendar.org/iCalendar-RFC-5545/3-6-5-time-zone-component.html
Suggested Fix
In order to fix this issue, I suggest VTIMEZONE markup is added to the file at: /civicrm/templates/CRM/Core/Calendar/ICal.tpl
It will require some dynamic code to pull the TZURL: from a lookup table and for the DTSTART/END for DAYLIGHT and STANDARD if the timezone uses DST. It may be that the values can be scraped from the TZURL file.
Cheers, Andrew