' % ustrfdate(day, '%B'))
def add_days_header(table=None):
"""Adds locale specific days header"""
# First print the header column with locale specific day
render = False
if table is None:
table = list()
render = True
monday = date(year=2008, month=9, day=15)
one_day = timedelta(days=1)
table.append(u'
')
for i in range(7):
day = monday + (one_day * i)
table.append(u'
%s
' % ustrfdate(day, '%a'))
table.append(u'
')
if render:
return u''.join(table)
def render_table(calendar, tm_name, read_only):
"""Renders the calendar rows"""
count = 0
table = list()
month = None
add_days_header(table)
today = datetime.today().date()
for date in sorted(calendar.keys()):
if date.month != month:
add_month_header(table, date)
table.append(u'