#!/usr/bin/env python # show python where the modules are import sys; sys.path.append('../'); sys.path.append('../../../') import web.error; web.error.enable() import web.util.calendarTools print web.header() calendars = [ 'web.util.calendarTools.month(year=2004,month=12)', """web.util.calendarTools.month( year=2004, month=12, dayNameLength=0, firstDay=5 )""", """web.util.calendarTools.month( year=2004, month=12, dayNameLength=3, monthURL = 'month.py?month=%(month)s&year=%(year)s', previousURL = 'previous.py?month=%(month)s&year=%(year)s', nextURL = 'next.py?month=%(month)s&year=%(year)s', previousHTML = 'prev', nextHTML = 'next', )""", """web.util.calendarTools.month( year=2004, month=12, daysURL = 'day.py?day=%(day)s&month=%(month)s&year=%(year)s', days = { 12:['day.py?day=12', 'twelve', 'style="background: #eee"'] } )""", """web.util.calendarTools.month( year=2004, month=12, tableColor = '#eeeecc', barColor = '#eeeeee', cellPadding = 16, )""", ] fullCal="""web.util.calendarTools.calendar( startYear=2004, startMonth=9, months=12, cols=3, dayNameLength=1, barColor="#eeeeee" ) """ output = '' for cal in calendars: output += """
%s
%s
"""%(eval(cal), web.encode(cal, mode='form')) print """

Example Calendars

This page demonstrates the parameters used to generate HTML calendars. They can also be styled using CSS stylesheets. For example the following is uses in this HTML page to make all the calendar headings a sans serif font:

<style>
.calendarTools-month-header{
    font-family: sans-serif;
    font-weight: bold;
}
</style>
%s

The next calendar is generated using the following code:

%s
%s """%(output, fullCal, eval(fullCal))