From 374452796c0fc83e22725af460dcc76297c3b9fb Mon Sep 17 00:00:00 2001 From: Cathy Nguyen Date: Tue, 17 Jan 2023 23:41:13 -0500 Subject: [PATCH] fix 00AM: Flipper may be Zero, but midnight isn't --- applications/main/clock_app/clock_app.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/applications/main/clock_app/clock_app.c b/applications/main/clock_app/clock_app.c index 47b2ba8bd..d2c178903 100644 --- a/applications/main/clock_app/clock_app.c +++ b/applications/main/clock_app/clock_app.c @@ -39,11 +39,12 @@ static void clock_render_callback(Canvas* const canvas, void* ctx) { } else { bool pm = curr_dt.hour > 12; bool pm12 = curr_dt.hour >= 12; + bool am12 = curr_dt.hour == 0; snprintf( time_string, TIME_LEN, CLOCK_TIME_FORMAT, - pm ? curr_dt.hour - 12 : curr_dt.hour, + pm ? curr_dt.hour - 12 : (am12 ? 12 : curr_dt.hour), curr_dt.minute, curr_dt.second); @@ -237,4 +238,4 @@ int32_t clock_app(void* p) { free(plugin_state); return 0; -} \ No newline at end of file +}