Make clock's alt format include the ISO week number

Set the default formatAlt to "dd MMMM 'W'ww yyyy" (was "dd MMMM yyyy")
in shell-defaults.json, the bundled settings-panel defaults, and the
form placeholder text — clock's own widget fallback already used this
spec but the shipped config overrode it.

Qt.formatDateTime doesn't recognize `ww` and renders it literally
(`20 May Www 2026`), so add an `isoWeek` helper to clock.qml that
pre-substitutes `ww` with a Qt-quoted literal of the ISO 8601 week
number before handing the format off to Qt. Users get `20 May W21 2026`
without anyone needing to know about the substitution.
This commit is contained in:
David Heinemeier Hansson
2026-05-20 21:37:48 +02:00
parent 2b03aec510
commit 3878ad3a57
3 changed files with 27 additions and 6 deletions
+2 -2
View File
@@ -132,7 +132,7 @@ Item {
layout: {
left: [{ id: "omarchy" }, { id: "workspaces" }],
center: [
{ id: "clock", format: "dddd HH:mm", formatAlt: "dd MMMM yyyy", verticalFormat: "HH\n\u2014\nmm" },
{ id: "clock", format: "dddd HH:mm", formatAlt: "dd MMMM 'W'ww yyyy", verticalFormat: "HH\n\u2014\nmm" },
{ id: "weather" }, { id: "indicators", items: [ "dnd", "nightlight", "stayAwake", "screenrecording", "dictation" ] }, { id: "systemUpdate" }
],
right: [
@@ -1205,7 +1205,7 @@ Item {
}
ClockField {
fieldKey: "formatAlt"
text: clockForm.entry.formatAlt || "dd MMMM yyyy"
text: clockForm.entry.formatAlt || "dd MMMM 'W'ww yyyy"
}
Text {