fix AM/PM
This commit is contained in:
parent
524e204ed1
commit
282e34dca1
|
@ -160,11 +160,21 @@ bool WatchFaceDigital::Refresh() {
|
||||||
if ( settingsController.GetClockType() == Controllers::Settings::ClockType::H24 ) {
|
if ( settingsController.GetClockType() == Controllers::Settings::ClockType::H24 ) {
|
||||||
sprintf(hoursChar, "%02d", hour);
|
sprintf(hoursChar, "%02d", hour);
|
||||||
} else {
|
} else {
|
||||||
if (hour > 12) {
|
if (hour == 0 && hour != 12) {
|
||||||
hour -= 12;
|
hour = 12;
|
||||||
sprintf(ampmChar, "PM");
|
sprintf(ampmChar, "AM");
|
||||||
} else {
|
}
|
||||||
sprintf(ampmChar, "AM");
|
else if (hour == 12 && hour != 0) {
|
||||||
|
hour = 12;
|
||||||
|
sprintf(ampmChar, "PM");
|
||||||
|
}
|
||||||
|
else if (hour < 12 && hour != 0) {
|
||||||
|
sprintf(ampmChar, "AM");
|
||||||
|
}
|
||||||
|
else if (hour > 12 && hour != 0)
|
||||||
|
{
|
||||||
|
hour = hour - 12;
|
||||||
|
sprintf(ampmChar, "PM");
|
||||||
}
|
}
|
||||||
sprintf(hoursChar, "%02d", hour);
|
sprintf(hoursChar, "%02d", hour);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user