-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
New issue
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
Highlight today in colour in calendar's CLI output #128317
Comments
) (#128357) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
) (#128358) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Thank you! |
…thon#128318) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Thanks, good idea. Please see PR #128498. |
Did you consider putting the feature in a private (As I said I'd hate to spoil the fun. Please do take my opinions just as input for consideration.) This feature adds some complexity to the API, but doesn't generalize to any other use cases -- for example, highlight weekends/holidays, not just the current day. Or highlight in HTML. Or highlight today in a pure text calendar, for example:
|
…thon#128318) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Hi @hugovk, I hope this is the right place to comment with my idea. I am interested in if there are any plans or interest in adding week number to the python calendar? According to this document (https://docs.python.org/3/library/time.html) %V for week is already a defined entity.
|
Hello! I think it could be useful. There's some potential complexity as some countries decide which is week 1 differently, but if we can follow ISO 8601 that would simplify things. The calendar module docs (https://docs.python.org/3/library/calendar.html) says ISO 8601 is used for other calculations:
The calendar module also allows you to define set a different weekday as the first one od the week, we'd need to check how that affects things. https://docs.python.org/3/library/calendar.html#calendar.setfirstweekday Please could you post a proposal to the ideas forum? https://discuss.python.org/c/ideas/6 Thanks! |
Using Hugo's dashboard: is this all done now? |
🎉
Thanks for the reminder, not yet: I was planning on giving Petr's suggestion a shot: #128317 (comment).
I hadn't, something like this? hugovk@8856aeb. It overrides There's quite a bit of duplication between each class's What do you think?
Thank you, it's very welcome! |
Thanks for considering it! The first commit does seem cleaner to me than putting terminal colours directly in |
Good idea, please see PR #129625. |
Co-authored-by: Petr Viktorin <encukou@gmail.com>
This change caused a regression. See #130665. |
Feature or enhancement
In Python 3.13 we added colour output to the new REPL, tracebacks and doctest, and in 3.14 to unittest and
test.regrtest
, which can also be controlled with thePYTHON_COLORS
,NO_COLOR
andFORCE_COLOR
environment variables:On macOS, the
cal
utility does something similar, but highlights today.The calendar module has a CLI to print out a calendar to the terminal, but with no highlighting. Let's add it.
Linked PRs
calendar.TextCalendar.formatweek
#128353calendar.TextCalendar.formatweek
(GH-128353) #128357calendar.TextCalendar.formatweek
(GH-128353) #128358The text was updated successfully, but these errors were encountered: