forked from Decentrala/website
fix uid in ical
This commit is contained in:
parent
35198a33d2
commit
4d4fd6d4d3
2
prep.py
2
prep.py
@ -60,10 +60,12 @@ def build_ical(events: list[dict]) -> str:
|
||||
created = str(today.year) + str(today.month).zfill(2) + str(today.day).zfill(2) + "T" + str(today.hour).zfill(2) + str(today.minute).zfill(2) + str(today.second).zfill(2) + "Z"
|
||||
time = event["time"]
|
||||
date = date + "T" + time.replace(":", "") + "00"
|
||||
uid = str(date.month).zfill(2) + str(date.day).zfill(2) + time[:2]
|
||||
|
||||
event_template = ""
|
||||
with open("template/event.ical", "r") as file:
|
||||
event_template += file.read()
|
||||
event_template = event_template.replace("<!--UID-->", uid)
|
||||
event_template = event_template.replace("<!--CREATED-->", created)
|
||||
event_template = event_template.replace("<!--DATE-->", date)
|
||||
event_template = event_template.replace("<!--TITLE-->", title)
|
||||
|
@ -1,5 +1,5 @@
|
||||
BEGIN:VEVENT
|
||||
UID:calendar.462701.field_date_time.0@radar.squat.net
|
||||
UID:calendar.<!--UID-->.field_date_time.0@radar.squat.net
|
||||
DTSTAMP:<!--CREATED-->
|
||||
CREATED:<!--CREATED-->
|
||||
DTSTART;TZID=Europe/Belgrade:<!--DATE-->
|
||||
|
Loading…
Reference in New Issue
Block a user