Skip to content

clock: add weeks-numbering option for configurable CW calculation#4940

Open
beyertom wants to merge 1 commit intoAlexays:masterfrom
beyertom:clock/configurable-week-numbering
Open

clock: add weeks-numbering option for configurable CW calculation#4940
beyertom wants to merge 1 commit intoAlexays:masterfrom
beyertom:clock/configurable-week-numbering

Conversation

@beyertom
Copy link
Copy Markdown

Summary

  • The iso8601 flag previously coupled calendar grid layout with week number
    format as a single boolean, giving no way to choose e.g. ISO week numbering
    independently of the locale's first-day-of-week setting
  • Adds a new calendar.weeks-numbering option (iso / monday / sunday)
    that explicitly controls only the week number calculation method
  • Existing behaviour is fully preserved when the option is not set

Usage

"calendar": {
  "weeks-pos": "right",
  "weeks-numbering": "iso"
}

Test plan

  • weeks-numbering not set → same behaviour as before (iso8601/locale driven)
  • weeks-numbering: "iso" → uses {:%V}, ISO 8601 week numbers
  • weeks-numbering: "monday" → uses {:%W}, Monday-based week numbers
  • weeks-numbering: "sunday" → uses {:%U}, Sunday-based week numbers
  • Invalid value logs a warning and falls back to locale default
  • Man page renders correctly (scdoc waybar-clock.5.scd)

The iso8601 flag previously controlled both the calendar grid layout
and the week number format as a coupled boolean. This adds a new
weeks-numbering option (iso/monday/sunday) that explicitly overrides
just the week number calculation method, independent of iso8601 and
locale settings. Existing behaviour is fully preserved when the option
is not set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant