From 685ad569a3d362c1b02cd2d26862059889232c9b Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 20 Jan 2026 20:53:34 +1100 Subject: background: fix desktop clock 12h format --- services/Time.qml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'services/Time.qml') diff --git a/services/Time.qml b/services/Time.qml index c4b3913..a07d9ef 100644 --- a/services/Time.qml +++ b/services/Time.qml @@ -1,6 +1,8 @@ pragma Singleton +import qs.config import Quickshell +import QtQuick Singleton { property alias enabled: clock.enabled @@ -9,6 +11,12 @@ Singleton { readonly property int minutes: clock.minutes readonly property int seconds: clock.seconds + readonly property string timeStr: format(Config.services.useTwelveHourClock ? "hh:mm:A" : "hh:mm") + readonly property list timeComponents: timeStr.split(":") + readonly property string hourStr: timeComponents[0] ?? "" + readonly property string minuteStr: timeComponents[1] ?? "" + readonly property string amPmStr: timeComponents[2] ?? "" + function format(fmt: string): string { return Qt.formatDateTime(clock.date, fmt); } -- cgit v1.2.3-freya