Open abe-101 opened 2 months ago
This is the code I use in the OpenWebCalendar:
Timezones with the same name are assumed to be the same. I do think that we should do that.
thanks for the reference - i see that you remove duplicate tzids that makes sense to me I just wonder what we should be doing if 2 calendars define the same tzid differently :shrug:
here is some psudocode
def merge(self) -> Calendar:
"""Merge the calendars."""
existing_tzids = set()
for cal in self.calendars:
for component in cal.walk("VTIMEZONE"):
tzid = component.get("tzid")
if tzid in existing_tzids:
continue
existing_tzids.add(tzid)
self.merged_calendar.add_component(component)
for component in cal.walk("VEVENT"):
....
what we should be doing if 2 calendars define the same tzid differently
I think, it is OK to remove duplication as the name is what is meant. I would say that the names are mostly standardized and we will not likely encounter a problem.
currently we only merge vevents its import to also gather vtimezone from each calendar and include it in the results