clock: add weeks-numbering option for configurable CW calculation

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>
This commit is contained in:
Thomas Beyer
2026-03-20 11:43:17 +01:00
co-authored by Claude Sonnet 4.6
parent ab7bfdb297
commit 86d516c74d
3 changed files with 42 additions and 9 deletions
+10 -2
View File
@@ -138,6 +138,13 @@ View all valid format options in *strftime(3)* or have a look https://en.cpprefe
:[ When enabled, the calendar follows the ISO 8601 standard: weeks begin on
Monday, and the first week of the year is numbered 1. The default week format is
'{:%V}'.
|[ *weeks-numbering*
:[ string
:[
:[ Override the week number calculation method, independent of *iso8601* and
locale settings. Possible values: *iso* (ISO 8601, {:%V}), *monday*
(Monday-based, {:%W}), *sunday* (Sunday-based, {:%U}). When not set, the
method is derived from *iso8601* or the locale.
3. Addressed by *clock: calendar: format*
[- *Option*
@@ -155,8 +162,9 @@ View all valid format options in *strftime(3)* or have a look https://en.cpprefe
|[ *weeks*
:[ string
:[ *{:%U}*
:[ Format is applied to week numbers. When weekday format is not provided then
is used default format: '{:%W}' when week starts with Monday, '{:%U}' otherwise
:[ Format is applied to week numbers. The *{}* placeholder is replaced with the
format determined by *weeks-numbering* (if set), otherwise by *iso8601* or the
locale: '{:%V}' for ISO 8601, '{:%W}' when week starts with Monday, '{:%U}' otherwise
|[ *weekdays*
:[ string
:[