diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2026-01-20 20:53:34 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2026-01-20 20:53:34 +1100 |
| commit | 685ad569a3d362c1b02cd2d26862059889232c9b (patch) | |
| tree | 44d991f9da1429800777b56c265d516ddcf6272c /services | |
| parent | controlcenter: add per-application audio controls (#1098) (diff) | |
| download | caelestia-shell-685ad569a3d362c1b02cd2d26862059889232c9b.tar.gz caelestia-shell-685ad569a3d362c1b02cd2d26862059889232c9b.tar.bz2 caelestia-shell-685ad569a3d362c1b02cd2d26862059889232c9b.zip | |
background: fix desktop clock 12h format
Diffstat (limited to 'services')
| -rw-r--r-- | services/Time.qml | 8 |
1 files changed, 8 insertions, 0 deletions
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<string> 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); } |