mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
fix 00AM: Flipper may be Zero, but midnight isn't
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user