Merge pull request #288 from Smileycathy1128/master

Oh boy 12AM!
This commit is contained in:
MX 2023-01-18 18:28:04 +03:00 committed by GitHub
commit dce2271330
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,11 +39,12 @@ static void clock_render_callback(Canvas* const canvas, void* ctx) {
} else { } else {
bool pm = curr_dt.hour > 12; bool pm = curr_dt.hour > 12;
bool pm12 = curr_dt.hour >= 12; bool pm12 = curr_dt.hour >= 12;
bool am12 = curr_dt.hour == 0;
snprintf( snprintf(
time_string, time_string,
TIME_LEN, TIME_LEN,
CLOCK_TIME_FORMAT, 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.minute,
curr_dt.second); curr_dt.second);