Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update calendar.rst
  • Loading branch information
StanFromIreland authored Dec 5, 2024
commit 8c17c78ac1f8f97cd672c24986fdecbf44559b85
27 changes: 22 additions & 5 deletions Doc/library/calendar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,24 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
the specified width, representing an empty day. The *weekday* parameter
represents the day of the week, where ``0`` is Monday and ``6`` is Sunday.

.. method:: formatweek()
.. method:: formatweek(theweek, width=2)
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated

.. method:: formatweekday()
Return a string representing an entire week formatted with the given width for each day.
The *theweek* parameter is a list of tuples, where each tuple contains a day of
the month or ``0`` for padding, and the corresponding weekday where 0 is
Monday and 6 is Sunday. Each day is padded to the specified width.
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated

.. method:: formatweekheader()
.. method:: formatweekday(weekday, width=2)
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated

Return a string representing the name of a single weekday formatted to
the specified width. The *weekday* parameter is an integer representing
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated
the day of the week, where 0 is Monday and 6 is Sunday.
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated

.. method:: formatweekheader(width=2)
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated

Return a string containing the header row of weekday names, formatted
with the given width for each column. The names depend on the locale
settings and are padded to the specified width.
Comment thread
StanFromIreland marked this conversation as resolved.

.. method:: formatmonth(theyear, themonth, w=0, l=0)

Expand All @@ -159,13 +172,17 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
on the first weekday as specified in the constructor or set by the
:meth:`setfirstweekday` method.

.. method:: formatmonthname()
.. method:: formatmonthname(theyear, themonth, width=0, withyear=True)

Return a string representing the month's name centered within the
specified width. If *withyear* is True, include the year in the
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated
output. The *theyear* and *themonth* parameters specify the year
and month for the name to be formatted.
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated

.. method:: prmonth(theyear, themonth, w=0, l=0)

Print a month's calendar as returned by :meth:`formatmonth`.


.. method:: formatyear(theyear, w=2, l=1, c=6, m=3)

Return a *m*-column calendar for an entire year as a multi-line string.
Expand Down