Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion shell/plugins/panels/clock/BarWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ BarWidget {
}

function formatted(date) {
return Qt.formatDateTime(date, activeFormat.replace(/ww/g, Model.isoWeekLiteral(date.getFullYear(), date.getMonth(), date.getDate())))
return date.toLocaleString(Qt.locale(), activeFormat.replace(/ww/g, Model.isoWeekLiteral(date.getFullYear(), date.getMonth(), date.getDate())))
Comment thread
ivanlegranbizarro marked this conversation as resolved.
Resolved
}

// ---- Calendar popup. Shape contract for shell.summon/hide/toggle
Expand Down
4 changes: 2 additions & 2 deletions shell/plugins/panels/clock/Panel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ Panel {
Text {
id: heroDate
anchors.verticalCenter: parent.verticalCenter
text: Qt.formatDate(root.today, "MMMM d")
text: root.today.toLocaleDateString(Qt.locale(), "MMMM d")
Comment thread
ivanlegranbizarro marked this conversation as resolved.
Resolved
color: heroMouse.containsMouse
? Style.hoverStateColor(root.contentForeground, Color.accent)
: root.contentForeground
Expand Down Expand Up @@ -713,7 +713,7 @@ Panel {
// "MAY 2026" and a "SEPTEMBER 2026".
width: Style.space(130)
horizontalAlignment: Text.AlignHCenter
text: Qt.formatDate(root.viewDate, "MMMM yyyy").toUpperCase()
text: root.viewDate.toLocaleDateString(Qt.locale(), "MMMM yyyy").toLocaleUpperCase()
color: Qt.darker(root.contentForeground, 1.4)
font.family: root.contentFontFamily
font.pixelSize: Style.font.body
Expand Down
3 changes: 2 additions & 1 deletion test/shell.d/clock-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ assert(/precision: root\.showsSeconds \? SystemClock\.Seconds : SystemClock\.Min
// must reach the label.
assert(/showsSeconds: Model\.clockNeedsSeconds\(activeFormat\)/.test(widgetSource), 'clock decides its tick rate from the format it is showing')
assert(/onDateChanged: root\.displayDate = date/.test(widgetSource), 'clock repaints the label on every tick')
assert(/return date\.toLocaleString\(Qt\.locale\(\), activeFormat\.replace/.test(widgetSource), 'clock formats the label with the system locale')
assert(/setting\("weekStartDay", null\)/.test(panelSource) && /persistSettings\(\{ weekStartDay:/.test(panelSource), 'calendar reads and writes the week start as weekStartDay')
assert(/updateEntryInline/.test(panelSource), 'calendar panel persists the week start to shell.json')
assert(/function moveMonth\(delta\)/.test(panelSource), 'calendar panel steps between months')
Expand All @@ -212,7 +213,7 @@ assert(/function close\(\) \{\s*\n\s*setCenterHoverRevealSuppressed\(false\)/.te
assert(/width: Math\.max\(calendarScroll\.width, gridColumn\.width\)/.test(panelSource), 'calendar scrolls rather than clipping the grid on a narrow popup')
assert(/enabled: !root\.viewingCurrentMonth/.test(panelSource) && /onClicked: root\.goToToday\(\)/.test(panelSource), 'calendar hero returns to today once the view has stepped away')
assert(!/clampMonth/.test(panelSource), 'calendar steps freely into future months')
assert(/Qt\.formatDate\(root\.today, "MMMM d"\)/.test(panelSource), 'calendar hero spells out today')
assert(/root\.today\.toLocaleDateString\(Qt\.locale\(\), "MMMM d"\)/.test(panelSource), 'calendar hero spells out today in the system locale')
Comment thread
ivanlegranbizarro marked this conversation as resolved.
Resolved
assert(/id: yearLabel/.test(panelSource) && /root\.yearDone/.test(panelSource), 'calendar panel shows the year progress bar')

// The memento mori bar is opt-in: double-tapping the year bar asks for an age,
Expand Down