The timezone now auto-corrects with DST (but still displays the same offset in the settings screen to the user)

This commit is contained in:
David Volovskiy
2024-08-02 01:25:01 -04:00
parent 149911e4ad
commit 4c546b14dc
22 changed files with 75 additions and 98 deletions

View File

@@ -157,8 +157,9 @@ static void totp_generate_and_display(totp_state_t *totp_state) {
totp_display(totp_state);
}
static inline uint32_t totp_compute_base_timestamp(movement_settings_t *settings) {
return watch_utility_date_time_to_unix_time(watch_rtc_get_date_time(), movement_timezone_offsets[settings->bit.time_zone] * 60);
static uint32_t totp_compute_base_timestamp(movement_settings_t *settings) {
watch_date_time date_time = watch_rtc_get_date_time();
return watch_utility_date_time_to_unix_time(date_time, get_timezone_offset(settings->bit.time_zone, date_time) * 60);
}
void totp_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {