Skip to content

Commit

Permalink
Merge pull request #19 from marcoancona/master
Browse files Browse the repository at this point in the history
update zones and zones-compiled
  • Loading branch information
mifi committed Dec 8, 2020
2 parents a0fb858 + 534e1e4 commit cb683b8
Show file tree
Hide file tree
Showing 4 changed files with 1,509 additions and 448 deletions.
4 changes: 2 additions & 2 deletions compile-zones.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ const zones = JSON.parse(zonesJson);

const out = {};
Object.keys(zones.zones).forEach((z) => {
out[z] = zones.zones[z].ics;
out[z] = zones.zones[z].ics.join('\r\n');
});

Object.keys(zones.aliases).forEach((z) => {
const aliasTo = zones.aliases[z].aliasTo;
if (zones.zones[aliasTo]) {
out[z] = zones.zones[aliasTo].ics;
out[z] = zones.zones[aliasTo].ics.join('\r\n');
} else {
console.warn(`${aliasTo} (${z}) not found, skipping`);
}
Expand Down
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
2 changes: 1 addition & 1 deletion zones-compiled.json

Large diffs are not rendered by default.

Loading

0 comments on commit cb683b8

Please sign in to comment.