diff --git a/epicyon-calendar.css b/epicyon-calendar.css index 112e2960..4379aa1b 100644 --- a/epicyon-calendar.css +++ b/epicyon-calendar.css @@ -103,6 +103,11 @@ a:link { position: relative; } +.calendar__day__event { + font-size: 2rem; + position: relative; +} + tr:nth-child(odd) > .calendar__day__cell:nth-child(odd) { color: var(--day-number); } diff --git a/webinterface.py b/webinterface.py index f4a7f111..df7ad67f 100644 --- a/webinterface.py +++ b/webinterface.py @@ -2839,7 +2839,31 @@ def htmlCalendarDay(translate: {}, \ calendarStr+='

'+str(dayNumber)+' '+monthName+'


'+str(year)+'\n' calendarStr+='\n' calendarStr+='\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+=''+eventTime+''+eventPlace+': '+eventDescription+'\n' + elif eventTime and eventDescription and not eventPlace: + calendarStr+=''+eventTime+''+eventDescription+'\n' + elif not eventTime and eventDescription and not eventPlace: + calendarStr+=''+eventDescription+'\n' + elif not eventTime and eventDescription and eventPlace: + calendarStr+=''+eventPlace+': '+eventDescription+'\n' + elif eventTime and not eventDescription and eventPlace: + calendarStr+=''+eventTime+''+eventPlace+'\n' + calendarStr+='\n' calendarStr+='\n' calendarStr+=htmlFooter()