Linebreaks

main2
Bob Mottram 2019-10-11 22:03:04 +01:00
parent 7b370b651b
commit f0adba1dba
2 changed files with 14 additions and 8 deletions

View File

@ -104,7 +104,13 @@ a:link {
} }
.calendar__day__event { .calendar__day__event {
font-size: 2rem; float: left;
font-size: 30px;
position: relative;
}
.calendar__day__time {
float: left;
font-size: 28px;
position: relative; position: relative;
} }

View File

@ -2848,22 +2848,22 @@ def htmlCalendarDay(translate: {}, \
if ev['type']=='Event': if ev['type']=='Event':
if ev.get('startTime'): if ev.get('startTime'):
eventDate=datetime.strptime(ev['startTime'],"%Y-%m-%dT%H:%M:%S%z") eventDate=datetime.strptime(ev['startTime'],"%Y-%m-%dT%H:%M:%S%z")
eventTime=eventDate.strftime("%H:%M") eventTime=eventDate.strftime("%H:%M").strip()
if ev.get('name'): if ev.get('name'):
eventDescription=ev['name'] eventDescription=ev['name'].strip()
elif ev['type']=='Place': elif ev['type']=='Place':
if ev.get('name'): if ev.get('name'):
eventPlace=ev['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__time"><b>'+eventTime+'</b></td><td class="calendar__day__event">'+eventPlace+'<br>'+eventDescription+'</td></tr>\n'
elif eventTime and eventDescription and not eventPlace: elif eventTime and eventDescription and not eventPlace:
calendarStr+='<tr><td class="calendar__day__event"><b>'+eventTime+'</b></td><td class="calendar__day__event">'+eventDescription+'</td></tr>\n' calendarStr+='<tr><td class="calendar__day__time"><b>'+eventTime+'</b></td><td class="calendar__day__event">'+eventDescription+'</td></tr>\n'
elif not eventTime and eventDescription and not eventPlace: elif not eventTime and eventDescription and not eventPlace:
calendarStr+='<tr><td class="calendar__day__event"></td><td class="calendar__day__event">'+eventDescription+'</td></tr>\n' calendarStr+='<tr><td class="calendar__day__time"></td><td class="calendar__day__event">'+eventDescription+'</td></tr>\n'
elif not eventTime and eventDescription and eventPlace: elif not eventTime and eventDescription and eventPlace:
calendarStr+='<tr><td class="calendar__day__event"></td><td class="calendar__day__event"><i>'+eventPlace+'</i>: '+eventDescription+'</td></tr>\n' calendarStr+='<tr><td class="calendar__day__time"></td><td class="calendar__day__event">'+eventPlace+'<br>'+eventDescription+'</td></tr>\n'
elif eventTime and not eventDescription and eventPlace: elif eventTime and not eventDescription and eventPlace:
calendarStr+='<tr><td class="calendar__day__event"><b>'+eventTime+'</b></td><td class="calendar__day__event"><i>'+eventPlace+'</i></td></tr>\n' calendarStr+='<tr><td class="calendar__day__time"><b>'+eventTime+'</b></td><td class="calendar__day__event">'+eventPlace+'</td></tr>\n'
calendarStr+='</tbody>\n' calendarStr+='</tbody>\n'
calendarStr+='</table></main>\n' calendarStr+='</table></main>\n'