Highlight today on calendar

main2
Bob Mottram 2019-10-10 21:51:36 +01:00
parent 08ce593ab8
commit 5a8f45c4d9
1 changed files with 11 additions and 2 deletions

View File

@ -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<daysInMonth) or \
(weekOfMonth==1 and dayNumber>=dow):
dayOfMonth+=1
calendarStr+=' <td class="calendar__day__cell">'+str(dayOfMonth)+'</td>\n'
isToday=False
if year==currDate.year:
if currDate.month==monthNumber:
if dayOfMonth==currDate.day:
isToday=True
if not isToday:
calendarStr+=' <td class="calendar__day__cell">'+str(dayOfMonth)+'</td>\n'
else:
calendarStr+=' <td class="calendar__day__cell" data-today="">'+str(dayOfMonth)+'</td>\n'
else:
calendarStr+=' <td class="calendar__day__cell"></td>\n'
calendarStr+=' </tr>\n'