| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -146,46 +146,61 @@ 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 | ||
| is unused. | ||
|
|
||
| .. method:: formatweek(theweek, w=0) | ||
| .. method:: formatweek(theweek, w=0, highlight_day=None) | ||
|
|
||
| Return a single week in a string with no newline. If *w* is provided, it | ||
| specifies the width of the date columns, which are centered. Depends | ||
| on the first weekday as specified in the constructor or set by the | ||
| :meth:`setfirstweekday` method. | ||
|
|
||
| .. versionchanged:: next | ||
| If *highlight_day* is given, this date is highlighted in color. | ||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityShould this say “using terminal escape sequences”?
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityHmm, I think it's more useful to describe the end result rather than the "how".
Sorry, something went wrong.
erlend-aasland reacted with thumbs up emoji
All reactions
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThat was my intention: mention that you need to print the result to a terminal to see the highlight. If you don't, you'll see some garbage bytes.
Sorry, something went wrong.
All reactions
|
||
| This can be :ref:`controlled using environment variables | ||
| <using-on-controlling-color>`. | ||
|
|
||
|
|
||
| .. method:: formatweekday(weekday, width) | ||
|
|
||
| Return a string representing the name of a single weekday formatted to | ||
| the specified *width*. The *weekday* parameter is an integer representing | ||
| the day of the week, where ``0`` is Monday and ``6`` is Sunday. | ||
|
|
||
|
|
||
| .. method:: formatweekheader(width) | ||
|
|
||
| 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. | ||
|
|
||
| .. method:: formatmonth(theyear, themonth, w=0, l=0) | ||
|
|
||
| .. method:: formatmonth(theyear, themonth, w=0, l=0, highlight_day=None) | ||
|
|
||
| Return a month's calendar in a multi-line string. If *w* is provided, it | ||
| specifies the width of the date columns, which are centered. If *l* is | ||
| given, it specifies the number of lines that each week will use. Depends | ||
| on the first weekday as specified in the constructor or set by the | ||
| :meth:`setfirstweekday` method. | ||
|
|
||
| .. versionchanged:: next | ||
| If *highlight_day* is given, this date is highlighted in color. | ||
| This can be :ref:`controlled using environment variables | ||
| <using-on-controlling-color>`. | ||
|
|
||
|
|
||
| .. 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 | ||
| output. The *theyear* and *themonth* parameters specify the year | ||
| and month for the name to be formatted respectively. | ||
|
|
||
|
|
||
| .. 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) | ||
| .. method:: formatyear(theyear, w=2, l=1, c=6, m=3, highlight_day=None) | ||
|
|
||
| Return a *m*-column calendar for an entire year as a multi-line string. | ||
| Optional parameters *w*, *l*, and *c* are for date column width, lines per | ||
| Expand All | @@ -194,6 +209,11 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is | |
| :meth:`setfirstweekday` method. The earliest year for which a calendar | ||
| can be generated is platform-dependent. | ||
|
|
||
| .. versionchanged:: next | ||
| If *highlight_day* is given, this date is highlighted in color. | ||
| This can be :ref:`controlled using environment variables | ||
| <using-on-controlling-color>`. | ||
|
|
||
|
|
||
| .. method:: pryear(theyear, w=2, l=1, c=6, m=3) | ||
|
|
||
| Expand Down Expand Up | @@ -549,7 +569,7 @@ The :mod:`calendar` module defines the following exceptions: | |
|
|
||
| .. _calendar-cli: | ||
|
|
||
| Command-Line Usage | ||
| Command-line usage | ||
|
Comment thread
hugovk marked this conversation as resolved.
|
||
| ------------------ | ||
|
|
||
| .. versionadded:: 2.5 | ||
| Expand Down Expand Up | @@ -687,6 +707,9 @@ The following options are accepted: | |
| The number of months printed per row. | ||
| Defaults to 3. | ||
|
|
||
| .. versionchanged:: next | ||
| By default, today's date is highlighted in color and can be | ||
| :ref:`controlled using environment variables <using-on-controlling-color>`. | ||
|
|
||
| *HTML-mode options:* | ||
|
|
||
| Expand Down | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Highlight today in colour in :mod:`calendar`'s CLI output. Patch by Hugo van | ||
| Kemenade. |
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.