Add datetime support

This commit is contained in:
Valentin Moguérou 2024-05-07 00:51:00 +02:00
parent a78aff9f9d
commit 78d1ab0392
1 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,5 @@
from datetime import date, time, datetime, timedelta
from pytz import timezone
import pytz
from uuid import uuid4
from os import path
from icalendar import Calendar, Event, vCalAddress, vText
@ -37,10 +37,11 @@ def to_calendar(student, term, include_EDT: bool = True):
event.add("summary", summary)
start = colle.datetime
print(start)
fin = start + colle.slot.duration
event.add("dtstart", start, parameters={"tzid": LOCAL_TZ})
event.add("dtend", fin, parameters={"tzid": LOCAL_TZ})
event.add("dtstart", start)
event.add("dtend", fin)
event.add("dtstamp", datetime.now())
event.add("uid", str(uuid4()))