From c98e72febc46143c10d3ff77a252c29d4bcd909d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 23 Feb 2020 10:20:10 +0000 Subject: [PATCH] Use events for one day --- webinterface.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/webinterface.py b/webinterface.py index 7a654048..e78f5e59 100644 --- a/webinterface.py +++ b/webinterface.py @@ -66,6 +66,7 @@ from shares import getValidSharedItemID from happening import todaysEventsCheck from happening import thisWeeksEventsCheck from happening import getCalendarEvents +from happening import getTodaysEvents def updateAvatarImageCache(session,baseDir: str,httpPrefix: str,actor: str,avatarUrl: str,personCache: {},force=False) -> str: """Updates the cached avatar for the given actor @@ -3735,17 +3736,17 @@ def htmlCalendar(translate: {}, \ monthNumber=currDate.month nickname=getNicknameFromActor(actor) - events=getCalendarEvents(baseDir,nickname,domain,year,monthNumber) - - months=('January','February','March','April','May','June','July','August','September','October','November','December') - monthName=translate[months[monthNumber-1]] if os.path.isfile(baseDir+'/img/calendar-background.png'): if not os.path.isfile(baseDir+'/accounts/calendar-background.png'): copyfile(baseDir+'/img/calendar-background.png',baseDir+'/accounts/calendar-background.png') + months=('January','February','March','April','May','June','July','August','September','October','November','December') + monthName=translate[months[monthNumber-1]] + if dayNumber: dayEvents=None + events=getTodaysEvents(baseDir,nickname,domain,year,monthNumber,dayNumber) if events.get(str(dayNumber)): dayEvents=events[str(dayNumber)] return htmlCalendarDay(translate,baseDir,path, \ @@ -3753,6 +3754,8 @@ def htmlCalendar(translate: {}, \ nickname,domain,dayEvents, \ monthName,actor) + events=getCalendarEvents(baseDir,nickname,domain,year,monthNumber) + prevYear=year prevMonthNumber=monthNumber-1 if prevMonthNumber<1: