// no idea why this was so hard to conceive function getFirstWeekPAD(firstDOW) { var firstWeekPad=0; var weekStartsOn=application.localeutils.weekStarts(); switch (weekStartsON) { case 1: firstWeekPAD=firstDOW-1; break; case 2: firstWeekPAD=firstDOW-2; if (firstWeekPAD LT 0) firstWeekPAD=firstWeekPAD+7; // handle leap years break; case 7: firstWeekPAD=7-abs(firstDOW-7); if (firstWeekPAD EQ 7) firstWeekPAD=0; break; } return firstWeekPAD; } localizedDays=application.localeutils.getLocalizedDays(); localizedMonth=application.localeutils.getLocalizedMonth(month); localizedYear=application.localeutils.getLocalizedYear(year); firstDay=createDate(year,month,1); firstDOW=dayOfWeek(firstDay); dim=daysInMonth(firstDay); firstWeekPAD=getFirstWeekPAD(firstDOW); lastMonth=dateAdd("m",-1,firstDay); nextMonth=dateAdd("m",1,firstDay); dayList=application.blog.getActiveDays(year,month); dayCounter=1; rowCounter=1;
#localizedDays[i]#
  class="calendarToday">#dayCounter##dayCounter#
class="calendarToday"> #x##x#