Update clock_app.c

This commit is contained in:
RogueMaster
2022-09-18 14:33:29 -04:00
parent 1e561385a6
commit 5d0e8cf8bd

View File

@@ -227,8 +227,8 @@ static void clock_render_callback(Canvas* const canvas, void* ctx) {
uint8_t hour = curr_dt.hour;
char strAMPM[3];
snprintf(strAMPM, sizeof(strAMPM), "%s", "AM");
if(!state->militaryTime && hour > 12) {
hour -= 12;
if(!state->militaryTime && hour >= 12) {
if(hour > 12) hour -= 12;
snprintf(strAMPM, sizeof(strAMPM), "%s", "PM");
}
snprintf(strings[1], 20, "%.2d:%.2d:%.2d", hour, curr_dt.minute, curr_dt.second);