Skip to content

Commit

Permalink
fix registration logic
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoancona authored and mifi committed Dec 8, 2020
1 parent c30347f commit c04908e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ class IcalExpander {
function registerTimezones() {
Object.keys(timezones).forEach((key) => {
const icsData = timezones[key];
const parsed = ICAL.parse(`BEGIN:VCALENDAR\nPRODID:-//tzurl.org//NONSGML Olson 2012h//EN\nVERSION:2.0\n${icsData}\nEND:VCALENDAR`);
const icsTimezone = `BEGIN:VTIMEZONE\r\nTZID:${key}\r\n${icsData}\r\nEND:VTIMEZONE`;
const parsed = ICAL.parse(`BEGIN:VCALENDAR\nPRODID:-//tzurl.org//NONSGML Olson 2012h//EN\nVERSION:2.0\n${icsTimezone}\nEND:VCALENDAR`);
const comp = new ICAL.Component(parsed);
const vtimezone = comp.getFirstSubcomponent('vtimezone');

Expand Down

0 comments on commit c04908e

Please sign in to comment.