diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-07-14 22:56:46 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-07-14 23:06:58 +0800 |
| commit | ec774a534d631f57ace0eb633dd64ed2f55ed8a6 (patch) | |
| tree | 7f0a15f005e54e181800eaa830ba46ee2604183c /services | |
| parent | a61860ea8ad4c91a0a25faf8b0a0e869236f8c07 (diff) | |
Revert "timedate: use 12 hr"
This reverts commit 49eef7abbfbca9f4a36870b226d5c70086f571be
Diffstat (limited to 'services')
| -rw-r--r-- | services/TimeDate.qml | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/services/TimeDate.qml b/services/TimeDate.qml index ff9343b..9c5b8df 100644 --- a/services/TimeDate.qml +++ b/services/TimeDate.qml @@ -5,7 +5,16 @@ import QtQuick Singleton { id: root - readonly property string time: Qt.formatDateTime(clock.date, "hh:mm:ss") + readonly property string time: { + // fuck you qt give me my 12 hr time + var h = clock.date.getHours(); + var m = clock.date.getMinutes(); + var s = clock.date.getSeconds(); + h = h % 12; + if (h === 0) + h = 12; + return (h < 10 ? "0" : "") + h + ":" + (m < 10 ? "0" : "") + m + ":" + (s < 10 ? "0" : "") + s; + } readonly property string date: Qt.formatDateTime(clock.date, "dddd dd/MM") SystemClock { |
