// time-oriented complication like a sunrise/sunset timer, and a simple locale preference could tell an
// altimeter to display feet or meters as easily as it tells a thermometer to display degrees in F or C.
bool clock_mode_24h : 1; // indicates whether clock should use 12 or 24 hour mode.
+ bool clock_24h_leading_zero : 1; // indicates whether clock should leading zero to indicate 24 hour mode.
bool use_imperial_units : 1; // indicates whether to use metric units (the default) or imperial.
bool alarm_enabled : 1; // indicates whether there is at least one alarm enabled.
- uint8_t reserved : 5; // room for more preferences if needed.
+ bool dst_active : 1; // indicates whether daylight savings time is active
- uint8_t reserved : 5; // room for more preferences if needed.
++ uint8_t reserved : 4; // room for more preferences if needed.
} bit;
uint32_t reg;
} movement_settings_t;
#include <stdlib.h>
#include "set_time_face.h"
#include "watch.h"
+#include "watch_utility.h"
- #define SET_TIME_FACE_NUM_SETTINGS (7)
- const char set_time_face_titles[SET_TIME_FACE_NUM_SETTINGS][3] = {"HR", "M1", "SE", "YR", "MO", "DA", "ZO"};
+ #define SET_TIME_FACE_NUM_SETTINGS (8)
+ const char set_time_face_titles[SET_TIME_FACE_NUM_SETTINGS][3] = {"HR", "M1", "SE", "YR", "MO", "DA", "ZO", "DS"};
static bool _quick_ticks_running;
settings->bit.time_zone++;
if (settings->bit.time_zone > 40) settings->bit.time_zone = 0;
break;
+ case 7: // daylight savings time
+ if (settings->bit.dst_active) { // deactivate DST
+ date_time.unit.hour = (date_time.unit.hour + 24 - 1) % 24;
+ settings->bit.time_zone = movement_dst_inverse_jump_table[settings->bit.time_zone];
+ } else { // activate DST
+ date_time.unit.hour = (date_time.unit.hour + 1) % 24;
+ settings->bit.time_zone = movement_dst_jump_table[settings->bit.time_zone];
+ }
+ settings->bit.dst_active = !settings->bit.dst_active;
+ 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;
watch_rtc_set_date_time(date_time);
}