Skip to content

Commit

Permalink
Fix iCalendar format issues
Browse files Browse the repository at this point in the history
  • Loading branch information
novanai committed Sep 30, 2024
1 parent 2dcaa2f commit dd0207b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion timetable/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,16 @@ def generate_ical_file(events: list[models.Event]) -> bytes:
calendar.add(
"PRODID", f"-//timetable.redbrick.dcu.ie//TimetableSync {__version__}//EN"
)
calendar.add("VERSION", __version__)
calendar.add("VERSION", "2.0")
calendar.add("DTSTAMP", datetime.datetime.now(datetime.timezone.utc))

for item in display_data:
event = icalendar.Event()
event.add("UID", item.original_event.identity)
event.add("LAST-MODIFIED", item.original_event.last_modified)
event.add("DTSTART", item.original_event.start)
event.add("DTEND", item.original_event.end)
event.add("DTSTAMP", item.original_event.last_modified)
event.add("SUMMARY", item.summary_long)
event.add(
"DESCRIPTION",
Expand Down

0 comments on commit dd0207b

Please sign in to comment.