summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/PineTimeStyle.cpp
diff options
context:
space:
mode:
authorKieran Cawthray <kieranc@gmail.com>2021-07-28 14:07:43 (GMT)
committerKieran Cawthray <kieranc@gmail.com>2021-07-28 14:07:43 (GMT)
commit12aeb4688923a06d574b7aa7262626e7eab5b7f1 (patch)
treee626b0e55e4144e6928632b17bada38b2aaade7d /src/displayapp/screens/PineTimeStyle.cpp
parente6bc485679022c51486ac3a28b8473b95ff0d115 (diff)
parent514481ef7f9c71ad816b31d979c6ab39ce9380dd (diff)
Merge remote-tracking branch 'upstream/develop' into pinetimestyle-colorpicker
Diffstat (limited to 'src/displayapp/screens/PineTimeStyle.cpp')
-rw-r--r--src/displayapp/screens/PineTimeStyle.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/displayapp/screens/PineTimeStyle.cpp b/src/displayapp/screens/PineTimeStyle.cpp
index afce698..337ceba 100644
--- a/src/displayapp/screens/PineTimeStyle.cpp
+++ b/src/displayapp/screens/PineTimeStyle.cpp
@@ -259,23 +259,23 @@ bool PineTimeStyle::Refresh() {
char hoursChar[3];
char ampmChar[5];
- if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) {
- sprintf(hoursChar, "%02d", hour);
- } else {
- if (hour == 0 && hour != 12) {
- hour = 12;
- sprintf(ampmChar, "A\nM");
- } else if (hour == 12 && hour != 0) {
- hour = 12;
- sprintf(ampmChar, "P\nM");
- } else if (hour < 12 && hour != 0) {
- sprintf(ampmChar, "A\nM");
- } else if (hour > 12 && hour != 0) {
- hour = hour - 12;
- sprintf(ampmChar, "P\nM");
- }
- sprintf(hoursChar, "%02d", hour);
+ if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) {
+ sprintf(hoursChar, "%02d", hour);
+ } else {
+ if (hour == 0 && hour != 12) {
+ hour = 12;
+ sprintf(ampmChar, "A\nM");
+ } else if (hour == 12 && hour != 0) {
+ hour = 12;
+ sprintf(ampmChar, "P\nM");
+ } else if (hour < 12 && hour != 0) {
+ sprintf(ampmChar, "A\nM");
+ } else if (hour > 12 && hour != 0) {
+ hour = hour - 12;
+ sprintf(ampmChar, "P\nM");
}
+ sprintf(hoursChar, "%02d", hour);
+ }
if (hoursChar[0] != displayedChar[0] || hoursChar[1] != displayedChar[1] || minutesChar[0] != displayedChar[2] ||
minutesChar[1] != displayedChar[3]) {
@@ -287,9 +287,9 @@ bool PineTimeStyle::Refresh() {
char hourStr[3];
char minStr[3];
- if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) {
+ if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) {
lv_label_set_text(timeAMPM, ampmChar);
- }
+ }
// Display the time as 2 pairs of digits
sprintf(hourStr, "%c%c", hoursChar[0], hoursChar[1]);