From db165bec30ab114a5da838278d095094b18d5291 Mon Sep 17 00:00:00 2001 From: Christian Buschau Date: Sat, 3 Aug 2024 12:22:15 +0200 Subject: [PATCH] Fix all days in a month --- movement/watch_faces/complication/day_one_face.c | 2 +- movement/watch_faces/complication/time_left_face.c | 2 +- movement/watch_faces/settings/set_time_face.c | 2 +- movement/watch_faces/settings/set_time_hackwatch_face.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/movement/watch_faces/complication/day_one_face.c b/movement/watch_faces/complication/day_one_face.c index 27601ed..d9bf0f7 100644 --- a/movement/watch_faces/complication/day_one_face.c +++ b/movement/watch_faces/complication/day_one_face.c @@ -27,7 +27,7 @@ #include "day_one_face.h" #include "watch.h" -static const uint8_t days_in_month[12] = {31, 29, 31, 30, 31, 30, 30, 31, 30, 31, 30, 31}; +static const uint8_t days_in_month[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; static uint32_t _day_one_face_juliandaynum(uint16_t year, uint16_t month, uint16_t day) { // from here: https://en.wikipedia.org/wiki/Julian_day#Julian_day_number_calculation diff --git a/movement/watch_faces/complication/time_left_face.c b/movement/watch_faces/complication/time_left_face.c index cc1077a..9992bbf 100644 --- a/movement/watch_faces/complication/time_left_face.c +++ b/movement/watch_faces/complication/time_left_face.c @@ -158,7 +158,7 @@ static void _draw(time_left_state_t *state, uint8_t subsecond) { /// @brief handle short or long pressing the alarm button static void _handle_alarm_button(time_left_state_t *state) { - const uint8_t days_in_month[12] = {31, 28, 31, 30, 31, 30, 30, 31, 30, 31, 30, 31}; + const uint8_t days_in_month[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; uint32_t tmp_day; switch (state->current_page) { case TIME_LEFT_FACE_SETTINGS_STATE: // birth year diff --git a/movement/watch_faces/settings/set_time_face.c b/movement/watch_faces/settings/set_time_face.c index a8c88e4..4b4be64 100644 --- a/movement/watch_faces/settings/set_time_face.c +++ b/movement/watch_faces/settings/set_time_face.c @@ -33,7 +33,7 @@ static bool _quick_ticks_running; static void _handle_alarm_button(movement_settings_t *settings, watch_date_time date_time, uint8_t current_page) { // handles short or long pressing of the alarm button - const uint8_t days_in_month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + const uint8_t days_in_month[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; switch (current_page) { case 0: // hour diff --git a/movement/watch_faces/settings/set_time_hackwatch_face.c b/movement/watch_faces/settings/set_time_hackwatch_face.c index fbe8cbb..269612f 100644 --- a/movement/watch_faces/settings/set_time_hackwatch_face.c +++ b/movement/watch_faces/settings/set_time_hackwatch_face.c @@ -47,7 +47,7 @@ void set_time_hackwatch_face_activate(movement_settings_t *settings, void *conte bool set_time_hackwatch_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { uint8_t current_page = *((uint8_t *)context); - const uint8_t days_in_month[12] = {31, 28, 31, 30, 31, 30, 30, 31, 30, 31, 30, 31}; + const uint8_t days_in_month[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; if (event.subsecond == 15) // Delay displayed time update by ~0.5 seconds, to align phase exactly to main clock at 1Hz date_time_settings = watch_rtc_get_date_time();