From 5a8f45c4d90edd45b8bc297bdac317c98e4dbd67 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 10 Oct 2019 21:51:36 +0100 Subject: [PATCH] Highlight today on calendar --- webinterface.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/webinterface.py b/webinterface.py index f2706602..84820120 100644 --- a/webinterface.py +++ b/webinterface.py @@ -2774,8 +2774,8 @@ def htmlCalendar(translate: {}, \ first=False actor=actor.split('?')[0] + currDate=datetime.now() if year==1970 and monthNumber==0: - currDate=datetime.now() year=currDate.year monthNumber=currDate.month @@ -2828,7 +2828,16 @@ def htmlCalendar(translate: {}, \ if (weekOfMonth>1 and dayOfMonth=dow): dayOfMonth+=1 - calendarStr+=' '+str(dayOfMonth)+'\n' + + isToday=False + if year==currDate.year: + if currDate.month==monthNumber: + if dayOfMonth==currDate.day: + isToday=True + if not isToday: + calendarStr+=' '+str(dayOfMonth)+'\n' + else: + calendarStr+=' '+str(dayOfMonth)+'\n' else: calendarStr+=' \n' calendarStr+=' \n'