summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/PineTimeStyle.cpp
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2021-07-25 17:54:05 +0300
committerGitHub <noreply@github.com>2021-07-25 16:54:05 +0200
commitec2469a6c1efea44692cf5e3a90160f96a6013d3 (patch)
tree24b19a9fc6df868152d9ffdee1ca41ac032aeb8f /src/displayapp/screens/PineTimeStyle.cpp
parent34949a47c59e7a4d8f67a0188bba6d08a046340d (diff)
Code cleanup (#466)
* Code cleanup * Remove override again
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 591f3a49..0efb4dc3 100644
--- a/src/displayapp/screens/PineTimeStyle.cpp
+++ b/src/displayapp/screens/PineTimeStyle.cpp
@@ -264,23 +264,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]) {
@@ -292,9 +292,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]);