Skip to content

Commit 282e34d

Browse files
committed
fix AM/PM
1 parent 524e204 commit 282e34d

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

src/displayapp/screens/WatchFaceDigital.cpp

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,21 @@ bool WatchFaceDigital::Refresh() {
160160
if ( settingsController.GetClockType() == Controllers::Settings::ClockType::H24 ) {
161161
sprintf(hoursChar, "%02d", hour);
162162
} else {
163-
if (hour > 12) {
164-
hour -= 12;
165-
sprintf(ampmChar, "PM");
166-
} else {
167-
sprintf(ampmChar, "AM");
163+
if (hour == 0 && hour != 12) {
164+
hour = 12;
165+
sprintf(ampmChar, "AM");
166+
}
167+
else if (hour == 12 && hour != 0) {
168+
hour = 12;
169+
sprintf(ampmChar, "PM");
170+
}
171+
else if (hour < 12 && hour != 0) {
172+
sprintf(ampmChar, "AM");
173+
}
174+
else if (hour > 12 && hour != 0)
175+
{
176+
hour = hour - 12;
177+
sprintf(ampmChar, "PM");
168178
}
169179
sprintf(hoursChar, "%02d", hour);
170180
}

0 commit comments

Comments
 (0)