Welcome to html-calendar’s documentation!
html-calendar
A simple HTML calendar generator with callbacks for adding links to date and formating classes
- htmlcalendar.htmlcalendar(starting_date, months=3, classes=<function nolist>, links=<function nostr>, attrs=<function noattrs>, th_classes=[], table_classes=[], caltype=0, backwards=True, header='h3', locale=None, safe=False)
Main function that takes a starting date and returns a list of tables containing months calendars in tables.
All tables generated have 6 rows, even the last one is empty.
- Parameters:
starting_date (datetime.date) – Any date object of the month we want to start generating from.
months (int) – The number of months we want to generate
classes (function) – A function that takes a datetime.date as parameter and returns a list of strings that will be put as classes of the table cell
links (function) – A function that takes a datetime.date as parameter and returns a fully qualified URL that will be linked to the date number. If the function returns none there is no link generated.
attrs – A dict of attributes to be inserted in the <td> tags.
th_classes (list) – A list of classes to be put in each one of the weekdays labels.
table_classes (list) – A list of classes to be put in the main table object.
caltype (int) – If you want weeks starting on sunday 1 else 0
backwards (bool) – If you want to generate the calendars to the past True else False
header (string) – Set the html header level for the calendar month name
locale (string) – Set the locale name used for naming month and week days names
safe (bool) – If false escapes all variables that go into the templates