@@ -138,13 +138,32 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
138
138
139
139
:class: `TextCalendar ` instances have the following methods:
140
140
141
+
142
+ .. method :: formatday(theday, weekday, width)
143
+
144
+ Return a string representing a single day formatted with the given *width *.
145
+ If *theday * is ``0 ``, return a string of spaces of
146
+ the specified width, representing an empty day. The *weekday * parameter
147
+ is unused.
148
+
141
149
.. method :: formatweek(theweek, w=0)
142
150
143
151
Return a single week in a string with no newline. If *w * is provided, it
144
152
specifies the width of the date columns, which are centered. Depends
145
153
on the first weekday as specified in the constructor or set by the
146
154
:meth: `setfirstweekday ` method.
147
155
156
+ .. method :: formatweekday(weekday, width)
157
+
158
+ Return a string representing the name of a single weekday formatted to
159
+ the specified *width *. The *weekday * parameter is an integer representing
160
+ the day of the week, where ``0 `` is Monday and ``6 `` is Sunday.
161
+
162
+ .. method :: formatweekheader(width)
163
+
164
+ Return a string containing the header row of weekday names, formatted
165
+ with the given *width * for each column. The names depend on the locale
166
+ settings and are padded to the specified width.
148
167
149
168
.. method :: formatmonth(theyear, themonth, w=0, l=0)
150
169
@@ -154,6 +173,12 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
154
173
on the first weekday as specified in the constructor or set by the
155
174
:meth: `setfirstweekday ` method.
156
175
176
+ .. method :: formatmonthname(theyear, themonth, width=0, withyear=True)
177
+
178
+ Return a string representing the month's name centered within the
179
+ specified *width *. If *withyear * is ``True ``, include the year in the
180
+ output. The *theyear * and *themonth * parameters specify the year
181
+ and month for the name to be formatted respectively.
157
182
158
183
.. method :: prmonth(theyear, themonth, w=0, l=0)
159
184
@@ -445,7 +470,7 @@ The :mod:`calendar` module exports the following data attributes:
445
470
446
471
A sequence that represents the months of the year in the current locale. This
447
472
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.
473
+ 13 and ``month_name[0] `` is the empty string.
449
474
450
475
>>> import calendar
451
476
>>> list (calendar.month_name)
0 commit comments