Buttons for previous and next month

main2
Bob Mottram 2019-10-11 15:23:23 +01:00
parent 2bb7e5f898
commit 4d35b7d5ad
3 changed files with 24 additions and 0 deletions

View File

@ -139,3 +139,11 @@ tr:nth-child(even) > .calendar__day__cell:nth-child(even) {
height: 5rem; height: 5rem;
text-transform: uppercase; text-transform: uppercase;
} }
.buttonprev {
width: 2%;
}
.buttonnext {
width: 2%;
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
}

BIN
img/icons/prev.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -2838,6 +2838,18 @@ def htmlCalendar(translate: {}, \
year=currDate.year year=currDate.year
monthNumber=currDate.month monthNumber=currDate.month
prevYear=year
prevMonthNumber=monthNumber-1
if prevMonthNumber<1:
prevMonthNumber=12
prevYear=year-1
nextYear=year
nextMonthNumber=monthNumber+1
if nextMonthNumber>12:
nextMonthNumber=1
nextYear=year+1
print('Calendar year='+str(year)+' month='+str(monthNumber)+ ' '+str(weekDayOfMonthStart(monthNumber,year))) print('Calendar year='+str(year)+' month='+str(monthNumber)+ ' '+str(weekDayOfMonthStart(monthNumber,year)))
nickname=getNicknameFromActor(actor) nickname=getNicknameFromActor(actor)
@ -2866,7 +2878,11 @@ def htmlCalendar(translate: {}, \
calendarStr=htmlHeader(cssFilename,calendarStyle) calendarStr=htmlHeader(cssFilename,calendarStyle)
calendarStr+='<main><table class="calendar">\n' calendarStr+='<main><table class="calendar">\n'
calendarStr+='<caption class="calendar__banner--month">\n' calendarStr+='<caption class="calendar__banner--month">\n'
calendarStr+=' <a href="'+actor+'/calendar?year='+str(prevYear)+'?month='+str(prevMonthNumber)+'">'
calendarStr+=' <img src="/icons/prev.png" class="buttonprev"/></a>\n'
calendarStr+=' <h1>'+monthName+'</h1>\n' calendarStr+=' <h1>'+monthName+'</h1>\n'
calendarStr+=' <a href="'+actor+'/calendar?year='+str(nextYear)+'?month='+str(nextMonthNumber)+'">'
calendarStr+=' <img src="/icons/prev.png" class="buttonnext"/></a>\n'
calendarStr+='</caption>\n' calendarStr+='</caption>\n'
calendarStr+='<thead>\n' calendarStr+='<thead>\n'
calendarStr+='<tr>\n' calendarStr+='<tr>\n'