1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-28 15:32:50 -05:00

feat: Use HH:MM format for 24hr clock system only

This commit is contained in:
Vantesh
2025-08-26 03:07:36 +03:00
parent 6785a1b854
commit bb81378b20
5 changed files with 5 additions and 5 deletions

View File

@@ -250,7 +250,7 @@ Rectangle {
if (modelData.allDay) { if (modelData.allDay) {
return "All day" return "All day"
} else { } else {
let timeFormat = SettingsData.use24HourClock ? "HH:mm" : "hh:mm AP" let timeFormat = SettingsData.use24HourClock ? "HH:mm" : "h:mm AP"
let startTime = Qt.formatTime( let startTime = Qt.formatTime(
modelData.start, timeFormat) modelData.start, timeFormat)
if (modelData.start.toDateString( if (modelData.start.toDateString(

View File

@@ -94,7 +94,7 @@ Item {
systemClock.date, systemClock.date,
"HH:mm") : Qt.formatTime( "HH:mm") : Qt.formatTime(
systemClock.date, systemClock.date,
"hh:mm AP") "h:mm AP")
font.pixelSize: 120 font.pixelSize: 120
font.weight: Font.Light font.weight: Font.Light
color: "white" color: "white"

View File

@@ -40,7 +40,7 @@ Rectangle {
text: SettingsData.use24HourClock ? Qt.formatTime( text: SettingsData.use24HourClock ? Qt.formatTime(
root.currentDate, root.currentDate,
"HH:mm") : Qt.formatTime( "HH:mm") : Qt.formatTime(
root.currentDate, "hh:mm AP") root.currentDate, "h:mm AP")
font.pixelSize: Theme.fontSizeMedium - 1 font.pixelSize: Theme.fontSizeMedium - 1
color: Theme.surfaceText color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter

View File

@@ -310,7 +310,7 @@ Singleton {
if (use24Hour) { if (use24Hour) {
return date.toLocaleTimeString(Qt.locale(), "HH:mm") return date.toLocaleTimeString(Qt.locale(), "HH:mm")
} else { } else {
return date.toLocaleTimeString(Qt.locale(), "hh:mm AP") return date.toLocaleTimeString(Qt.locale(), "h:mm AP")
} }
} }

View File

@@ -115,7 +115,7 @@ Singleton {
} }
function checkTimeBasedCycling() { function checkTimeBasedCycling() {
const currentTime = Qt.formatTime(systemClock.date, "hh:mm") const currentTime = Qt.formatTime(systemClock.date, "h:mm")
if (currentTime === cachedCyclingTime if (currentTime === cachedCyclingTime
&& currentTime !== lastTimeCheck) { && currentTime !== lastTimeCheck) {