.. class:: Calendar(firstweekday=0)
Creates a :class:`Calendar` object. *firstweekday* is an integer specifying the
- first day of the week. ``0`` is Monday (the default), ``6`` is Sunday.
+ first day of the week. :const:`MONDAY` is ``0`` (the default), :const:`SUNDAY` is ``6``.
A :class:`Calendar` object provides several methods that can be used for
preparing the calendar data for formatting. This class doesn't do any formatting
locale. This follows normal convention of January being month number 1, so it
has a length of 13 and ``month_abbr[0]`` is the empty string.
+.. data:: MONDAY
+ TUESDAY
+ WEDNESDAY
+ THURSDAY
+ FRIDAY
+ SATURDAY
+ SUNDAY
+
+ Aliases for day numbers, where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``.
.. seealso::
"monthcalendar", "prmonth", "month", "prcal", "calendar",
"timegm", "month_name", "month_abbr", "day_name", "day_abbr",
"Calendar", "TextCalendar", "HTMLCalendar", "LocaleTextCalendar",
- "LocaleHTMLCalendar", "weekheader"]
+ "LocaleHTMLCalendar", "weekheader",
+ "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY",
+ "SATURDAY", "SUNDAY"]
# Exception raised for bad input (with string parameter for details)
error = ValueError
class MiscTestCase(unittest.TestCase):
def test__all__(self):
not_exported = {
- 'mdays', 'January', 'February', 'EPOCH', 'MONDAY', 'TUESDAY',
- 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY',
+ 'mdays', 'January', 'February', 'EPOCH',
'different_locale', 'c', 'prweek', 'week', 'format',
'formatstring', 'main', 'monthlen', 'prevmonth', 'nextmonth'}
support.check__all__(self, calendar, not_exported=not_exported)
--- /dev/null
+Improve day constants in :mod:`calendar`.
+
+Now all constants (`MONDAY` ... `SUNDAY`) are documented, tested, and added
+to ``__all__``.