Calendar: added support for 12 hours format.

This commit is contained in:
ItsLemmy
2025-10-05 14:13:46 -04:00
parent 17fa29abc4
commit feed6e905c
7 changed files with 25 additions and 21 deletions
+2 -2
View File
@@ -610,8 +610,8 @@
"description": "Anpassen, wie Datum und Zeit erscheinen."
},
"12hour-format": {
"label": "12-Stunden-Zeitformat auf dem Sperrbildschirm verwenden",
"description": "An für AM/PM-Format (z.B. 8:00 PM), aus für 24-Stunden-Format (z.B. 20:00)."
"description": "An für AM/PM-Format (z.B. 8:00 PM), aus für 24-Stunden-Format (z.B. 20:00).",
"label": "Benutze das 12-Stunden-Zeitformat."
},
"week-numbers": {
"label": "Wochennummern anzeigen",
+1 -1
View File
@@ -608,7 +608,7 @@
"description": "Customize how date and time appear."
},
"12hour-format": {
"label": "Use 12-hour time format on the lock screen",
"label": "Use 12-hour time format.",
"description": "On for AM/PM format (e.g., 8:00 PM), off for 24-hour format (e.g., 20:00)."
},
"week-numbers": {
+2 -2
View File
@@ -606,8 +606,8 @@
"description": "Personaliza cómo aparecen la fecha y la hora."
},
"12hour-format": {
"label": "Usar formato de 12 horas en la pantalla de bloqueo",
"description": "Activado para formato AM/PM (ej., 8:00 PM), desactivado para formato de 24 horas (ej., 20:00)."
"description": "Activado para formato AM/PM (ej., 8:00 PM), desactivado para formato de 24 horas (ej., 20:00).",
"label": "Utilice el formato de hora de 12 horas."
},
"week-numbers": {
"label": "Mostrar números de semana",
+1 -1
View File
@@ -606,7 +606,7 @@
"description": "Personnalisez l'affichage de la date et de l'heure."
},
"12hour-format": {
"label": "Utiliser le format horaire de 12 heures sur l'écran de verrouillage",
"label": "Utiliser le format horaire de 12 heures",
"description": "Activé pour le format AM/PM (ex: 8:00 PM), désactivé pour le format 24 heures (ex: 20:00)."
},
"week-numbers": {
+2 -2
View File
@@ -572,8 +572,8 @@
"description": "Personalize como a data e a hora aparecem."
},
"12hour-format": {
"label": "Usar formato de 12 horas na tela de bloqueio",
"description": "Ativado para formato AM/PM (ex., 8:00 PM), desativado para formato de 24 horas (ex., 20:00)."
"description": "Ativado para formato AM/PM (ex., 8:00 PM), desativado para formato de 24 horas (ex., 20:00).",
"label": "Use o formato de hora de 12 horas."
},
"week-numbers": {
"label": "Mostrar números da semana",
+2 -2
View File
@@ -606,8 +606,8 @@
"description": "自定义日期和时间的显示方式。"
},
"12hour-format": {
"label": "在锁屏上使用 12 小时制",
"description": "开启为 AM/PM 格式(例如:8:00 PM),关闭为 24 小时制(例如:20:00)。"
"description": "开启为 AM/PM 格式(例如:8:00 PM),关闭为 24 小时制(例如:20:00)。",
"label": "使用 12 小时制时间格式。"
},
"week-numbers": {
"label": "显示周数",
+15 -11
View File
@@ -95,9 +95,15 @@ NPanel {
anchors.fill: parent
property real progress: Time.date.getSeconds() / 60
onProgressChanged: requestPaint()
Connections {
target: Time
function onDateChanged() {
secondsProgress.progress = Time.date.getSeconds() / 60
}
}
onPaint: {
var ctx = getContext("2d")
var centerX = width / 2
@@ -122,22 +128,20 @@ NPanel {
ctx.stroke()
}
Connections {
target: Time
function onDateChanged() {
secondsProgress.progress = (Time.date.getSeconds() + Time.date.getMilliseconds() / 1000) / 60
}
}
}
// Digital clock
ColumnLayout {
anchors.centerIn: parent
spacing: -2 * scaling
spacing: -3 * scaling
NText {
text: Qt.formatTime(Time.date, "HH")
pointSize: Style.fontSizeL * 0.7 * scaling
text: {
var t = Settings.data.location.use12hourFormat ? Qt.locale().toString(new Date(), "hh AP") : Qt.locale().toString(new Date(), "HH")
return t.split(" ")[0]
}
pointSize: Style.fontSizeS * scaling
font.weight: Style.fontWeightBold
color: Color.mOnPrimary
family: Settings.data.ui.fontFixed
@@ -146,7 +150,7 @@ NPanel {
NText {
text: Qt.formatTime(Time.date, "mm")
pointSize: Style.fontSizeL * 0.7 * scaling
pointSize: Style.fontSizeS * scaling
font.weight: Style.fontWeightBold
color: Color.mOnPrimary
family: Settings.data.ui.fontFixed