fixed ics generation
This commit is contained in:
parent
4068fab565
commit
2b5277a3a0
7 changed files with 98 additions and 56 deletions
|
@ -56,8 +56,10 @@ def find_events(icsfilestr, start, end, num):
|
|||
if event.name == "VEVENT":
|
||||
if "RRULE" in event.keys():
|
||||
events.extend(parse_recurring_event(event, start, end))
|
||||
elif ev := parse_single_event(event, start, end) != None:
|
||||
events.append(ev)
|
||||
else:
|
||||
ev = parse_single_event(event, start, end)
|
||||
if ev is not None:
|
||||
events.append(ev)
|
||||
|
||||
events = sorted(events, key=lambda k: k["begin"])
|
||||
events = events[0:num]
|
||||
|
|
|
@ -18,6 +18,10 @@ for icsfilestr in glob("public/*/**/*.ics", recursive=True):
|
|||
|
||||
for calendar in calendars:
|
||||
for event in calendar.subcomponents:
|
||||
if event.name != "VEVENT":
|
||||
continue
|
||||
if "DTSTART" not in event:
|
||||
continue
|
||||
merged.add_component(event)
|
||||
|
||||
outfile = "static/all.ics"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue