Merge branch 'main' of github.com:joeycastillo/second-movement

This commit is contained in:
joeycastillo
2024-10-27 14:23:33 -04:00
10 changed files with 25 additions and 33 deletions

View File

@@ -51,7 +51,7 @@ static void _handle_alarm_button(watch_date_time_t date_time, uint8_t current_pa
date_time.unit.month = (date_time.unit.month % 12) + 1;
break;
case 3: { // day
date_time.unit.day = date_time.unit.day + 1;
date_time.unit.day = (date_time.unit.day % watch_utility_days_in_month(date_time.unit.month, date_time.unit.year + WATCH_RTC_REFERENCE_YEAR)) + 1;
break;
case 4: // hour
date_time.unit.hour = (date_time.unit.hour + 1) % 24;
@@ -64,8 +64,6 @@ static void _handle_alarm_button(watch_date_time_t date_time, uint8_t current_pa
break;
}
}
if (date_time.unit.day > days_in_month(date_time.unit.month, date_time.unit.year + WATCH_RTC_REFERENCE_YEAR))
date_time.unit.day = 1;
movement_set_local_date_time(date_time);
}