mirror of https://gitlab.com/bashrc2/epicyon
Show daily events on calendar
parent
521249499b
commit
3464fee873
|
@ -103,6 +103,11 @@ a:link {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.calendar__day__event {
|
||||||
|
font-size: 2rem;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
tr:nth-child(odd) > .calendar__day__cell:nth-child(odd) {
|
tr:nth-child(odd) > .calendar__day__cell:nth-child(odd) {
|
||||||
color: var(--day-number);
|
color: var(--day-number);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2839,7 +2839,31 @@ def htmlCalendarDay(translate: {}, \
|
||||||
calendarStr+=' <h1>'+str(dayNumber)+' '+monthName+'</h1><br>'+str(year)+'\n'
|
calendarStr+=' <h1>'+str(dayNumber)+' '+monthName+'</h1><br>'+str(year)+'\n'
|
||||||
calendarStr+='</caption>\n'
|
calendarStr+='</caption>\n'
|
||||||
calendarStr+='<tbody>\n'
|
calendarStr+='<tbody>\n'
|
||||||
#TODO
|
|
||||||
|
eventTime=None
|
||||||
|
eventDescription=None
|
||||||
|
eventPlace=None
|
||||||
|
for ev in dayEvents:
|
||||||
|
if ev['type']=='Event':
|
||||||
|
if ev.get('startTime'):
|
||||||
|
eventDate=datetime.datetime.strptime(ev['startTime'],"%Y-%m-%dT%H:%M:%S%z")
|
||||||
|
eventTime=eventDate.strftime("%H:%M")
|
||||||
|
if ev.get('name'):
|
||||||
|
eventDescription=ev['name']
|
||||||
|
elif ev['type']=='Place':
|
||||||
|
if ev.get('name'):
|
||||||
|
eventPlace=ev['name']
|
||||||
|
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'
|
||||||
|
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'
|
||||||
|
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'
|
||||||
|
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'
|
||||||
|
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+='</tbody>\n'
|
calendarStr+='</tbody>\n'
|
||||||
calendarStr+='</table></main>\n'
|
calendarStr+='</table></main>\n'
|
||||||
calendarStr+=htmlFooter()
|
calendarStr+=htmlFooter()
|
||||||
|
|
Loading…
Reference in New Issue