on repeating single day events, the dtstart can no (longer?) be extracted -> handle like a single date event
This commit is contained in:
parent
77dd449d3e
commit
7385ada9b5
@ -121,7 +121,7 @@ def fetch_calendar():
|
||||
#eventsList[day][eventUuid]["description"] = str(component.get('description'))
|
||||
|
||||
startDate = component.get('dtstart')
|
||||
#print(" dtstart: %s (%s)" % (startDate.dt.strftime('%m/%d/%Y %H:%M'), day))
|
||||
# print(" dtstart: %s == %s?" % (startDate.dt.strftime('%m/%d/%Y %H:%M'), day))
|
||||
if startDate.dt.strftime('%m/%d/%Y') == day.strftime('%m/%d/%Y'): # event starts today
|
||||
# print(" single day event")
|
||||
eventsList[day][eventUuid]["startDate"] = startDate.dt.strftime('%m/%d/%Y')
|
||||
@ -129,8 +129,8 @@ def fetch_calendar():
|
||||
else: # event started before today, set startdate to day and start time to midnight (for multi day events with start/end time)
|
||||
# print(" multi day event")
|
||||
eventsList[day][eventUuid]["startDate"] = day.strftime('%m/%d/%Y')
|
||||
eventsList[day][eventUuid]["startTime"] = "00:00"
|
||||
|
||||
# eventsList[day][eventUuid]["startTime"] = "00:00" # No longer working!
|
||||
eventsList[day][eventUuid]["startTime"] = (startDate.dt + datetime.timedelta(hours=utcOffset)).strftime('%H:%M')
|
||||
|
||||
try:
|
||||
endDate = component.get('dtend')
|
||||
@ -140,7 +140,8 @@ def fetch_calendar():
|
||||
eventsList[day][eventUuid]["endTime"] = (endDate.dt + datetime.timedelta(hours=utcOffset)).strftime('%H:%M')
|
||||
else: # event ends after today, set enddate to day and end time to midnight (for multi day events with start/end time)
|
||||
eventsList[day][eventUuid]["endDate"] = day.strftime('%m/%d/%Y')
|
||||
eventsList[day][eventUuid]["endTime"] = "24:00"
|
||||
# eventsList[day][eventUuid]["endTime"] = "24:00" # No longer working!
|
||||
eventsList[day][eventUuid]["endDate"] = endDate.dt.strftime('%m/%d/%Y')
|
||||
|
||||
except AttributeError as ae: # event has no endtime, use duration
|
||||
#print(" %s" % ae)
|
||||
|
Loading…
Reference in New Issue
Block a user