This module is used by Morgen desktop and backend services to convert between IANA timezone names and other formats. It relies on data from the following sources:
moment-timezone
(https://github.com/moment/moment-timezone)@vvo/tzdb
(https://github.com/vvo/tzdb)timezones-ical-library
(https://github.com/arethetypeswrong/timezones-ical-library)tzdata
(https://www.npmjs.com/package/tzdata)
Required to create events with the EWS API.
const windowsZone = TimezoneService.Timezone.ianaToWindows(ianaZone);
Requires when fetching events from EWS or the Graph API, as we always store the zone in the database as a IANA zone.
const ianaZone = new TimezoneService.Timezone(windowsZone).ianaName;
This is needed because clients may not be able to handle the full IANA zone names. For example, the mobile app might have a limited number of zones in the local database therefore we want to avoid sending legacy aliases.
const canonicalZone = new TimezoneService.Timezone(ianaZone).ianaName;
Interestingly, both moment-timezone
and @vvo/tzdb
are unreliable for this opeation
For example:
moment-timezone
saysEurope/Kiev
is canonical, while it should beEurope/Kyiv
@vvo/tzdb
groups names by country and offset, creating spurious links, likeAustralia/Hobart
is linked toAustralia/syndey
but it should not.
We found that tzdata
is the most reliable source for this operation.
This is needed to generate iCalendar VTIMEZONE components, which in turn is required to generate iCalendar files.
const vtimezone = TimezoneService.Timezone.getVTimeZoneComponent(zone);
- Update
moment-timezone
,luxon
,tzdata
,@vvo/tzdb
andtimezones-ical-library
to the latest versions. - Update
scripts/data/windowsZones.xml
with the latest Windows timezone data. - Run
npm run build
to update the data files and run the tests. - Push the changes to the repository.
- Update the commit hash in the
package.json
of other projects fetching this repo from Github.