Allow days in the future

With this small change you can also count down to a important upcoming event!

This is my first time coding in C, so please double check everything! But in the emulator this seemed to work!
This commit is contained in:
kingannoy 2023-02-02 00:28:29 +01:00 committed by joeycastillo
parent 827c3eb4a4
commit c814c780e3

View File

@ -37,7 +37,11 @@ static void _day_one_face_update(day_one_state_t state) {
watch_date_time date_time = watch_rtc_get_date_time();
uint32_t julian_date = _day_one_face_juliandaynum(date_time.unit.year + WATCH_RTC_REFERENCE_YEAR, date_time.unit.month, date_time.unit.day);
uint32_t julian_birthdate = _day_one_face_juliandaynum(state.birth_year, state.birth_month, state.birth_day);
sprintf(buf, "DA %6lu", julian_date - julian_birthdate);
if (julian_date < julian_birthdate) {
sprintf(buf, "DA %6lu", julian_birthdate - julian_date);
} else {
sprintf(buf, "DA %6lu", julian_date - julian_birthdate);
}
watch_display_string(buf, 0);
}