@@ -38,13 +38,33 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
3838 itself. This is the job of subclasses.
3939
4040
41- :class: `Calendar ` instances have the following methods:
41+ :class: `Calendar ` instances have the following methods and attributes:
42+
43+ .. attribute :: firstweekday
44+
45+ The first weekday as an integer (0--6).
46+
47+ This property can also be set and read using
48+ :meth: `~Calendar.setfirstweekday ` and
49+ :meth: `~Calendar.getfirstweekday ` respectively.
50+
51+ .. method :: getfirstweekday()
52+
53+ Return an :class: `int ` for the current first weekday (0--6).
54+
55+ Identical to reading the :attr: `~Calendar.firstweekday ` property.
56+
57+ .. method :: setfirstweekday(firstweekday)
58+
59+ Set the first weekday to *firstweekday *, passed as an :class: `int ` (0--6)
60+
61+ Identical to setting the :attr: `~Calendar.firstweekday ` property.
4262
4363 .. method :: iterweekdays()
4464
4565 Return an iterator for the week day numbers that will be used for one
4666 week. The first value from the iterator will be the same as the value of
47- the :attr: `firstweekday ` property.
67+ the :attr: `~Calendar. firstweekday ` property.
4868
4969
5070 .. method :: itermonthdates(year, month)
@@ -138,13 +158,32 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
138158
139159 :class: `TextCalendar ` instances have the following methods:
140160
161+
162+ .. method :: formatday(theday, weekday, width)
163+
164+ Return a string representing a single day formatted with the given *width *.
165+ If *theday * is ``0 ``, return a string of spaces of
166+ the specified width, representing an empty day. The *weekday * parameter
167+ is unused.
168+
141169 .. method :: formatweek(theweek, w=0)
142170
143171 Return a single week in a string with no newline. If *w * is provided, it
144172 specifies the width of the date columns, which are centered. Depends
145173 on the first weekday as specified in the constructor or set by the
146174 :meth: `setfirstweekday ` method.
147175
176+ .. method :: formatweekday(weekday, width)
177+
178+ Return a string representing the name of a single weekday formatted to
179+ the specified *width *. The *weekday * parameter is an integer representing
180+ the day of the week, where ``0 `` is Monday and ``6 `` is Sunday.
181+
182+ .. method :: formatweekheader(width)
183+
184+ Return a string containing the header row of weekday names, formatted
185+ with the given *width * for each column. The names depend on the locale
186+ settings and are padded to the specified width.
148187
149188 .. method :: formatmonth(theyear, themonth, w=0, l=0)
150189
@@ -154,6 +193,12 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
154193 on the first weekday as specified in the constructor or set by the
155194 :meth: `setfirstweekday ` method.
156195
196+ .. method :: formatmonthname(theyear, themonth, width=0, withyear=True)
197+
198+ Return a string representing the month's name centered within the
199+ specified *width *. If *withyear * is ``True ``, include the year in the
200+ output. The *theyear * and *themonth * parameters specify the year
201+ and month for the name to be formatted respectively.
157202
158203 .. method :: prmonth(theyear, themonth, w=0, l=0)
159204
@@ -445,7 +490,7 @@ The :mod:`calendar` module exports the following data attributes:
445490
446491 A sequence that represents the months of the year in the current locale. This
447492 follows normal convention of January being month number 1, so it has a length of
448- 13 and ``month_name[0] `` is the empty string.
493+ 13 and ``month_name[0] `` is the empty string.
449494
450495 >>> import calendar
451496 >>> list (calendar.month_name)
0 commit comments