Skip to content

Commit c04908e

Browse files
marcoanconamifi
authored andcommitted
fix registration logic
1 parent c30347f commit c04908e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ class IcalExpander {
131131
function registerTimezones() {
132132
Object.keys(timezones).forEach((key) => {
133133
const icsData = timezones[key];
134-
const parsed = ICAL.parse(`BEGIN:VCALENDAR\nPRODID:-//tzurl.org//NONSGML Olson 2012h//EN\nVERSION:2.0\n${icsData}\nEND:VCALENDAR`);
134+
const icsTimezone = `BEGIN:VTIMEZONE\r\nTZID:${key}\r\n${icsData}\r\nEND:VTIMEZONE`;
135+
const parsed = ICAL.parse(`BEGIN:VCALENDAR\nPRODID:-//tzurl.org//NONSGML Olson 2012h//EN\nVERSION:2.0\n${icsTimezone}\nEND:VCALENDAR`);
135136
const comp = new ICAL.Component(parsed);
136137
const vtimezone = comp.getFirstSubcomponent('vtimezone');
137138

0 commit comments

Comments
 (0)