@@ -9,15 +9,35 @@ \section{\module{calendar} ---
99
1010This module allows you to output calendars like the \UNIX {}
1111\program {cal} program, and provides additional useful functions
12- related to the calendar.
12+ related to the calendar. By default, these calendars have Monday as
13+ the first day of the week, and Sunday as the last (the European
14+ convention). Use \function {setfirstweekday()} to set the first day of the
15+ week to Sunday (6) or to any other weekday.
16+
17+ \begin {funcdesc }{setfirstweekday}{weekday}
18+ Sets the weekday (\code {0} is Monday, \code {6} is Sunday) to start
19+ each week. The values \constant {MONDAY}, \constant {TUESDAY},
20+ \constant {WEDNESDAY}, \constant {THURSDAY}, \constant {FRIDAY},
21+ \constant {SATURDAY}, and \constant {SUNDAY} are provided for
22+ convenience. For example, to set the first weekday to Sunday:
23+
24+ \begin {verbatim }
25+ import calendar
26+ calendar.setfirstweekday(calendar.SUNDAY)
27+ \end {verbatim }
28+ \end {funcdesc }
29+
30+ \begin {funcdesc }{firstweekday}{}
31+ Returns the current setting for the weekday to start each week.
32+ \end {funcdesc }
1333
1434\begin {funcdesc }{isleap}{year}
1535Returns true if \var {year} is a leap year.
1636\end {funcdesc }
1737
18- \begin {funcdesc }{leapdays}{year1, year2 }
19- Return the number of leap years in the range
20- [\var {year1 }\ldots\var {year2 }].
38+ \begin {funcdesc }{leapdays}{y1, y2 }
39+ Returns the number of leap years in the range
40+ [\var {y1 }\ldots\var {y2 }].
2141\end {funcdesc }
2242
2343\begin {funcdesc }{weekday}{year, month, day}
@@ -34,17 +54,32 @@ \section{\module{calendar} ---
3454\begin {funcdesc }{monthcalendar}{year, month}
3555Returns a matrix representing a month's calendar. Each row represents
3656a week; days outside of the month a represented by zeros.
57+ Each week begins with Monday unless set by \function {setfirstweekday()}.
58+ \end {funcdesc }
59+
60+ \begin {funcdesc }{prmonth}{theyear, themonth\optional {, w\optional {, l}}}
61+ Prints a month's calendar as returned by \function {month()}.
62+ \end {funcdesc }
63+
64+ \begin {funcdesc }{month}{theyear, themonth\optional {, w\optional {, l}}}
65+ Returns a month's calendar in a multi-line string. If \var {w} is
66+ provided, it specifies the width of the date columns, which are
67+ centered. If \var {l} is given, it specifies the number of lines that
68+ each week will use. Depends on the first weekday as set by
69+ \function {setfirstweekday()}.
3770\end {funcdesc }
3871
39- \begin {funcdesc }{prmonth}{year, month\optional {, width\optional {, length}}}
40- Prints a month's calendar. If \var {width} is provided, it specifies
41- the width of the columns that the numbers are centered in. If
42- \var {length} is given, it specifies the number of lines that each
43- week will use.
72+ \begin {funcdesc }{prcal}{year\optional {, w\optional {, l\optional {c}}}}
73+ Prints the calendar for an entire year as returned by
74+ \function {calendar()}.
4475\end {funcdesc }
4576
46- \begin {funcdesc }{prcal}{year}
47- Prints the calendar for the year \var {year}.
77+ \begin {funcdesc }{calendar}{year\optional {, w\optional {, l\optional {c}}}}
78+ Returns a 3-column calendar for an entire year as a multi-line string.
79+ Optional parameters \var {w}, \var {l}, and \var {c} are for date column
80+ width, lines per week, and number of spaces between month columns,
81+ respectively. Depends on the first weekday as set by
82+ \function {setfirstweekday()}.
4883\end {funcdesc }
4984
5085\begin {funcdesc }{timegm}{tuple}
0 commit comments