Maj UI Reskreen

This commit is contained in:
Ambulance Clerc
2022-11-26 16:40:41 +01:00
parent 19d456873d
commit d8540c7c1c
6 changed files with 327 additions and 63 deletions

View File

@@ -67,6 +67,10 @@ class cls_caldav():
elif periode == 2:
tomorow = date + timedelta(days=1)
events = recurring_ical_events.of(Calendar.from_ical(self.data)).between(today,tomorow)
elif periode == 3:
today = date + timedelta(days=-1)
tomorow = date + timedelta(days=2)
events = recurring_ical_events.of(Calendar.from_ical(self.data)).between(today,tomorow)
elif periode == 7:
endweek = date + timedelta(days=7)
events = recurring_ical_events.of(Calendar.from_ical(self.data)).between(today,endweek)
@@ -113,7 +117,7 @@ class cls_caldav():
item.dtstart = event["DTSTART"].dt.strftime("%d.%m.%Y %H:%M")
item.dtstamp = int(event["DTSTART"].dt.strftime("%Y%m%d%H%M"))
print(item.dtstamp)
#print(item.dtstamp)
item.dtend = event["DTEND"].dt.strftime("%d.%m.%Y %H:%M")
@@ -126,10 +130,11 @@ class cls_caldav():
if type(start) is Datetime.date:
start = datetime.combine(start, datetime.min.time())
print("convert Date to datetime")
print(start)
print(f"Parse Data {item.name} start:{start}")
if int(start.strftime("%H")) < 19:
self.day.append(item)
if int(start.strftime("%H")) >= 19:
print("add to night ****")
self.night.append(item)