const char set_time_face_titles[SET_TIME_FACE_NUM_SETTINGS][3] = {"HR", "M1", "SE", "YR", "MO", "DA", " "};
static bool _quick_ticks_running;
+static int32_t current_offset;
static void _handle_alarm_button(watch_date_time date_time, uint8_t current_page) {
// handles short or long pressing of the alarm button
case 6: // time zone
movement_set_timezone_index(movement_get_timezone_index() + 1);
if (movement_get_timezone_index() >= NUM_ZONE_NAMES) movement_set_timezone_index(0);
+ current_offset = movement_get_current_timezone_offset_for_zone(movement_get_timezone_index());
break;
}
if (date_time.unit.day > days_in_month(date_time.unit.month, date_time.unit.year + WATCH_RTC_REFERENCE_YEAR))
*((uint8_t *)context) = 0;
movement_request_tick_frequency(4);
_quick_ticks_running = false;
+ current_offset = movement_get_current_timezone_offset();
}
bool set_time_face_loop(movement_event_t event, void *context) {
sprintf(buf, "%2d%02d%02d", date_time.unit.year + 20, date_time.unit.month, date_time.unit.day);
} else {
watch_display_text(WATCH_POSITION_TOP_RIGHT, " Z");
+ if (current_offset < 0) watch_display_text(WATCH_POSITION_TOP_LEFT, "- ");
+ else watch_display_text(WATCH_POSITION_TOP_LEFT, "* ");
if (event.subsecond % 2) {
- memset(buf, ' ', sizeof(buf));
+ uint8_t hours = abs(current_offset) / 3600;
+ uint8_t minutes = (abs(current_offset) % 3600) / 60;
+
+ sprintf(buf, "%2d%02d ", hours % 100, minutes % 100);
+ watch_set_colon();
} else {
- watch_display_text(WATCH_POSITION_TOP_LEFT, (char *) (zone_names + 11 * movement_get_timezone_index()));
sprintf(buf, "%s", (char *) (3 + zone_names + 11 * movement_get_timezone_index()));
+ watch_clear_colon();
}
}