Nested lists

main2
Bob Mottram 2019-10-11 21:52:15 +01:00
parent 3464fee873
commit 29b94eef31
1 changed files with 14 additions and 13 deletions

View File

@ -2840,19 +2840,20 @@ def htmlCalendarDay(translate: {}, \
calendarStr+='</caption>\n' calendarStr+='</caption>\n'
calendarStr+='<tbody>\n' calendarStr+='<tbody>\n'
eventTime=None for eventPost in dayEvents:
eventDescription=None eventTime=None
eventPlace=None eventDescription=None
for ev in dayEvents: eventPlace=None
if ev['type']=='Event': for ev in eventPost:
if ev.get('startTime'): if ev['type']=='Event':
eventDate=datetime.datetime.strptime(ev['startTime'],"%Y-%m-%dT%H:%M:%S%z") if ev.get('startTime'):
eventTime=eventDate.strftime("%H:%M") eventDate=datetime.datetime.strptime(ev['startTime'],"%Y-%m-%dT%H:%M:%S%z")
if ev.get('name'): eventTime=eventDate.strftime("%H:%M")
eventDescription=ev['name'] if ev.get('name'):
elif ev['type']=='Place': eventDescription=ev['name']
if ev.get('name'): elif ev['type']=='Place':
eventPlace=ev['name'] if ev.get('name'):
eventPlace=ev['name']
if eventTime and eventDescription and eventPlace: if eventTime and eventDescription and eventPlace:
calendarStr+='<tr><td class="calendar__day__event"><b>'+eventTime+'</b></td><td class="calendar__day__event"><i>'+eventPlace+'</i>: '+eventDescription+'</td></tr>\n' calendarStr+='<tr><td class="calendar__day__event"><b>'+eventTime+'</b></td><td class="calendar__day__event"><i>'+eventPlace+'</i>: '+eventDescription+'</td></tr>\n'
elif eventTime and eventDescription and not eventPlace: elif eventTime and eventDescription and not eventPlace: