Web www.gerd-tentler.de
Version 2.16 (released Feb. 12, 2012) [Download]

Introduction

Use this Python class to create a monthly calendar. It's easy to use and highly customizable, supports multiple languages, and you can choose whether weeks start with Saturday, Sunday, Monday, or any other day. Of course you can create as many calendars as you like. Have a look at the example below. It shows five calendars; the current month (big in the middle) plus the two previous months (left) and the two next months (right):

Example:

week numbers  

October 2017
SuMoTuWeThFrSa 
123456740
89101112131441
1516171819202142
2223242526272843
293031    44

November 2017
SuMoTuWeThFrSa 
   123444
56789101145
1213141516171846
1920212223242547
2627282930  48
December 2017
SuMoTuWeThFrSa 
     1248
345678949
1011121314151650
1718192021222351
2425262728293052
31      1
January 2018
SuMoTuWeThFrSa 
 1234561
789101112132
141516171819203
212223242526274
28293031   5

February 2018
SuMoTuWeThFrSa 
    1235
456789106
111213141516177
181920212223248
25262728   9

In 1582, Gregory XIII made a calendar reformation (advanced leap year rules + 10 days have been dropped in October) and created the Gregorian calendar, which is in use since then. Therefore HTML-Calendar applies the Gregorian calendar for years > 1582, and the old Julian calendar for years <= 1582.

Regarding week numbers, HTML-Calendar applies the following rules:
  • One week consists of 7 days.
  • The first week of a year must contain at least 4 days, or else it will appear as last week of the previous year. This may vary depending on the day that starts the week (Saturday, Sunday, Monday...).

Important notes for users of older HTML-Calendar versions

In version 2.7, two variables were removed: tdFontColor and tdBGColor. They were replaced by a new variable tdBorderColor. This has been done because the current day (today) is now just marked by a border, leaving font color and background color unchanged.

In version 2.15, the calendar.py file has been renamed to htmlCalendar.py, because a module with this name already exists in the Python library.

Be sure to update any scripts that use HTML-Calendar accordingly. Sorry for the inconvenience.

Change Log

Version 2.16
  • Fixed events on specific weekdays in leap years.
Version 2.15
  • Fixed week numbers in year 1582.
  • Fixed events on specific weekdays in October 1582.
  • Renamed calendar.py to htmlCalendar.py.
Version 2.14
  • Send date in YYYY-MM-DD format when day is clicked.
  • Added possibility to view events on specific weekdays.
Version 2.13
  • Fixed calendar when only one week is selected.
Version 2.12
  • Added support for multiple events within the same time period.
  • Added possiblity to set link target.
Version 2.11
  • Added support for links with parameters.
Version 2.10
  • Added possibility to view only a certain week.

Comments