Readds leap year checks (#2)

This commit is contained in:
voloved
2024-10-27 14:04:56 -04:00
committed by GitHub
parent c0514ad39a
commit d05a851d94
7 changed files with 15 additions and 25 deletions

View File

@@ -64,13 +64,11 @@ static void _day_one_face_increment(day_one_state_t *state) {
state->birth_month = (state->birth_month % 12) + 1;
break;
case PAGE_DAY:
state->birth_day = state->birth_day + 1;
state->birth_day = (state->birth_day % watch_utility_days_in_month(state->birth_month, state->birth_year)) + 1;
break;
default:
break;
}
if (state->birth_day == 0 || state->birth_day > days_in_month(state->birth_month, state->birth_year))
state->birth_day = 1;
}
void day_one_face_setup(uint8_t watch_face_index, void ** context_ptr) {