date format is now a build-time choice, not tied to 12/24h setting
This commit is contained in:
parent
7d74749b45
commit
c78e210f3c
3 changed files with 8 additions and 2 deletions
|
@ -10,6 +10,7 @@ namespace Pinetime {
|
||||||
class Settings {
|
class Settings {
|
||||||
public:
|
public:
|
||||||
enum class ClockType : uint8_t { H24, H12 };
|
enum class ClockType : uint8_t { H24, H12 };
|
||||||
|
enum class DateType : uint8_t { Ddmy, Dmdy };
|
||||||
enum class WeatherFormat : uint8_t { Metric, Imperial };
|
enum class WeatherFormat : uint8_t { Metric, Imperial };
|
||||||
enum class Notification : uint8_t { On, Off, Sleep };
|
enum class Notification : uint8_t { On, Off, Sleep };
|
||||||
enum class ChimesOption : uint8_t { None, Hours, HalfHours };
|
enum class ChimesOption : uint8_t { None, Hours, HalfHours };
|
||||||
|
@ -181,6 +182,11 @@ namespace Pinetime {
|
||||||
return settings.clockType;
|
return settings.clockType;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
DateType GetDateType() const {
|
||||||
|
// a build-time choice (no run-time setting)
|
||||||
|
return DateType::Ddmy;
|
||||||
|
};
|
||||||
|
|
||||||
void SetWeatherFormat(WeatherFormat weatherFormat) {
|
void SetWeatherFormat(WeatherFormat weatherFormat) {
|
||||||
if (weatherFormat != settings.weatherFormat) {
|
if (weatherFormat != settings.weatherFormat) {
|
||||||
settingsChanged = true;
|
settingsChanged = true;
|
||||||
|
|
|
@ -252,7 +252,7 @@ void WatchFaceCasioStyleG7710::Refresh() {
|
||||||
Controllers::DateTime::Months month = dateTimeController.Month();
|
Controllers::DateTime::Months month = dateTimeController.Month();
|
||||||
uint8_t day = dateTimeController.Day();
|
uint8_t day = dateTimeController.Day();
|
||||||
int dayOfYear = dateTimeController.DayOfYear();
|
int dayOfYear = dateTimeController.DayOfYear();
|
||||||
if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) {
|
if (settingsController.GetDateType() == Controllers::Settings::DateType::Ddmy) {
|
||||||
// 24h mode: ddmmyyyy, first DOW=Monday;
|
// 24h mode: ddmmyyyy, first DOW=Monday;
|
||||||
lv_label_set_text_fmt(label_date, "%3d-%2d", day, month);
|
lv_label_set_text_fmt(label_date, "%3d-%2d", day, month);
|
||||||
weekNumberFormat = "%V"; // Replaced by the week number of the year (Monday as the first day of the week) as a decimal number
|
weekNumberFormat = "%V"; // Replaced by the week number of the year (Monday as the first day of the week) as a decimal number
|
||||||
|
|
|
@ -138,7 +138,7 @@ void WatchFaceDigital::Refresh() {
|
||||||
uint16_t year = dateTimeController.Year();
|
uint16_t year = dateTimeController.Year();
|
||||||
uint8_t day = dateTimeController.Day();
|
uint8_t day = dateTimeController.Day();
|
||||||
Controllers::DateTime::Days dayOfWeek = dateTimeController.DayOfWeek();
|
Controllers::DateTime::Days dayOfWeek = dateTimeController.DayOfWeek();
|
||||||
if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) {
|
if (settingsController.GetDateType() == Controllers::Settings::DateType::Ddmy) {
|
||||||
lv_label_set_text_fmt(label_date,
|
lv_label_set_text_fmt(label_date,
|
||||||
"%s %d %s %d",
|
"%s %d %s %d",
|
||||||
dateTimeController.DayOfWeekShortToStringLow(dayOfWeek),
|
dateTimeController.DayOfWeekShortToStringLow(dayOfWeek),
|
||||||
|
|
Loading…
Add table
Reference in a new issue