Revert "Support leading zero representation for 24h clock"
This reverts commit f633b7634b.
This commit is contained in:
@@ -293,7 +293,6 @@ static void _activity_update_logging_screen(movement_settings_t *settings, activ
|
||||
}
|
||||
// Briefly, show time without seconds
|
||||
else {
|
||||
bool set_leading_zero = false;
|
||||
watch_clear_indicator(WATCH_INDICATOR_LAP);
|
||||
watch_date_time now = watch_rtc_get_date_time();
|
||||
uint8_t hour = now.unit.hour;
|
||||
@@ -305,18 +304,14 @@ static void _activity_update_logging_screen(movement_settings_t *settings, activ
|
||||
watch_set_indicator(WATCH_INDICATOR_PM);
|
||||
hour %= 12;
|
||||
if (hour == 0) hour = 12;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
watch_set_indicator(WATCH_INDICATOR_24H);
|
||||
watch_clear_indicator(WATCH_INDICATOR_PM);
|
||||
if (!settings->bit.clock_24h_leading_zero)
|
||||
watch_set_indicator(WATCH_INDICATOR_24H);
|
||||
else if (hour < 10)
|
||||
set_leading_zero = true;
|
||||
}
|
||||
sprintf(activity_buf, "%2d%02d ", hour, now.unit.minute);
|
||||
watch_set_colon();
|
||||
watch_display_string(activity_buf, 4);
|
||||
if (set_leading_zero)
|
||||
watch_display_string("0", 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,6 @@ static void _alarm_face_draw(movement_settings_t *settings, alarm_state_t *state
|
||||
i = state->alarm[state->alarm_idx].day + 1;
|
||||
}
|
||||
//handle am/pm for hour display
|
||||
bool set_leading_zero = false;
|
||||
uint8_t h = state->alarm[state->alarm_idx].hour;
|
||||
if (!settings->bit.clock_mode_24h) {
|
||||
if (h >= 12) {
|
||||
@@ -84,12 +83,6 @@ static void _alarm_face_draw(movement_settings_t *settings, alarm_state_t *state
|
||||
if (h == 0) h = 12;
|
||||
} else {
|
||||
watch_set_indicator(WATCH_INDICATOR_24H);
|
||||
|
||||
if (settings->bit.clock_24h_leading_zero) {
|
||||
if (h < 10) {
|
||||
set_leading_zero = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(buf, set_leading_zero? "%c%c%2d%02d%02d " : "%c%c%2d%2d%02d ",
|
||||
|
||||
@@ -228,7 +228,6 @@ static void _planetary_hours(movement_settings_t *settings, planetary_hours_stat
|
||||
uint8_t weekday, planet, planetary_hour;
|
||||
uint32_t current_hour_epoch;
|
||||
watch_date_time scratch_time;
|
||||
bool set_leading_zero = false;
|
||||
|
||||
// check if we have a location. If not, display error
|
||||
if ( state->no_location ) {
|
||||
@@ -254,7 +253,7 @@ static void _planetary_hours(movement_settings_t *settings, planetary_hours_stat
|
||||
return;
|
||||
}
|
||||
|
||||
if (settings->bit.clock_mode_24h && !settings->bit.clock_24h_leading_zero) watch_set_indicator(WATCH_INDICATOR_24H);
|
||||
if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H);
|
||||
|
||||
// roll over hour iterator
|
||||
if ( state->hour < 0 ) state->hour = 23;
|
||||
@@ -314,8 +313,6 @@ static void _planetary_hours(movement_settings_t *settings, planetary_hours_stat
|
||||
}
|
||||
scratch_time.unit.hour %= 12;
|
||||
if (scratch_time.unit.hour == 0) scratch_time.unit.hour = 12;
|
||||
} else if (settings->bit.clock_24h_leading_zero && scratch_time.unit.hour < 10) {
|
||||
set_leading_zero = true;
|
||||
}
|
||||
|
||||
// planetary ruler of the hour
|
||||
@@ -331,8 +328,6 @@ static void _planetary_hours(movement_settings_t *settings, planetary_hours_stat
|
||||
|
||||
watch_set_colon();
|
||||
watch_display_string(buf, 0);
|
||||
if (set_leading_zero)
|
||||
watch_display_string("0", 4);
|
||||
|
||||
if ( state->ruler == 2 ) _planetary_icon(planet);
|
||||
}
|
||||
|
||||
@@ -206,7 +206,6 @@ static void _planetary_time(movement_event_t event, movement_settings_t *setting
|
||||
double night_hour_count = 0.0;
|
||||
uint8_t weekday, planet, planetary_hour;
|
||||
double hour_duration, current_hour, current_minute, current_second;
|
||||
bool set_leading_zero = false;
|
||||
|
||||
watch_set_colon();
|
||||
|
||||
@@ -219,7 +218,7 @@ static void _planetary_time(movement_event_t event, movement_settings_t *setting
|
||||
return;
|
||||
}
|
||||
|
||||
if (settings->bit.clock_mode_24h && !settings->bit.clock_24h_leading_zero) watch_set_indicator(WATCH_INDICATOR_24H);
|
||||
if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H);
|
||||
|
||||
// PM for night hours, otherwise the night hours are counted from 13
|
||||
if ( state->night ) {
|
||||
@@ -247,9 +246,6 @@ static void _planetary_time(movement_event_t event, movement_settings_t *setting
|
||||
state->scratch.unit.minute = floor(current_minute);
|
||||
state->scratch.unit.second = (uint8_t)floor(current_second) % 60;
|
||||
|
||||
if (settings->bit.clock_mode_24h && settings->bit.clock_24h_leading_zero && state->scratch.unit.hour < 10)
|
||||
set_leading_zero = true;
|
||||
|
||||
// what weekday is it (0 - 6)
|
||||
weekday = watch_utility_get_iso8601_weekday_number(state->scratch.unit.year, state->scratch.unit.month, state->scratch.unit.day) - 1;
|
||||
|
||||
@@ -267,8 +263,6 @@ static void _planetary_time(movement_event_t event, movement_settings_t *setting
|
||||
else sprintf(buf, "%s h%2d%02d%02d", ruler, state->scratch.unit.hour, state->scratch.unit.minute, state->scratch.unit.second);
|
||||
|
||||
watch_display_string(buf, 0);
|
||||
if (set_leading_zero)
|
||||
watch_display_string("0", 4);
|
||||
|
||||
if ( state->ruler == 2 ) _planetary_icon(planet);
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ static void _sunrise_sunset_face_update(movement_settings_t *settings, sunrise_s
|
||||
}
|
||||
|
||||
watch_set_colon();
|
||||
if (settings->bit.clock_mode_24h && !settings->bit.clock_24h_leading_zero) watch_set_indicator(WATCH_INDICATOR_24H);
|
||||
if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H);
|
||||
|
||||
rise += hours_from_utc;
|
||||
set += hours_from_utc;
|
||||
@@ -113,17 +113,12 @@ static void _sunrise_sunset_face_update(movement_settings_t *settings, sunrise_s
|
||||
|
||||
if (date_time.reg < scratch_time.reg || show_next_match) {
|
||||
if (state->rise_index == 0 || show_next_match) {
|
||||
bool set_leading_zero = false;
|
||||
if (!settings->bit.clock_mode_24h) {
|
||||
if (watch_utility_convert_to_12_hour(&scratch_time)) watch_set_indicator(WATCH_INDICATOR_PM);
|
||||
else watch_clear_indicator(WATCH_INDICATOR_PM);
|
||||
} else if (settings->bit.clock_24h_leading_zero && scratch_time.unit.hour < 10) {
|
||||
set_leading_zero = true;
|
||||
}
|
||||
sprintf(buf, "rI%2d%2d%02d%s", scratch_time.unit.day, scratch_time.unit.hour, scratch_time.unit.minute,longLatPresets[state->longLatToUse].name);
|
||||
watch_display_string(buf, 0);
|
||||
if (set_leading_zero)
|
||||
watch_display_string("0", 4);
|
||||
return;
|
||||
} else {
|
||||
show_next_match = true;
|
||||
@@ -145,17 +140,12 @@ static void _sunrise_sunset_face_update(movement_settings_t *settings, sunrise_s
|
||||
|
||||
if (date_time.reg < scratch_time.reg || show_next_match) {
|
||||
if (state->rise_index == 0 || show_next_match) {
|
||||
bool set_leading_zero = false;
|
||||
if (!settings->bit.clock_mode_24h) {
|
||||
if (watch_utility_convert_to_12_hour(&scratch_time)) watch_set_indicator(WATCH_INDICATOR_PM);
|
||||
else watch_clear_indicator(WATCH_INDICATOR_PM);
|
||||
} else if (settings->bit.clock_24h_leading_zero && scratch_time.unit.hour < 10) {
|
||||
set_leading_zero = true;
|
||||
}
|
||||
sprintf(buf, "SE%2d%2d%02d%s", scratch_time.unit.day, scratch_time.unit.hour, scratch_time.unit.minute, longLatPresets[state->longLatToUse].name);
|
||||
watch_display_string(buf, 0);
|
||||
if (set_leading_zero)
|
||||
watch_display_string("0", 4);
|
||||
return;
|
||||
} else {
|
||||
show_next_match = true;
|
||||
|
||||
@@ -38,15 +38,12 @@ void _wake_face_update_display(movement_settings_t *settings, wake_face_state_t
|
||||
uint8_t hour = state->hour;
|
||||
|
||||
watch_clear_display();
|
||||
bool set_leading_zero = false;
|
||||
if ( !settings->bit.clock_mode_24h ) {
|
||||
if ( settings->bit.clock_mode_24h )
|
||||
watch_set_indicator(WATCH_INDICATOR_24H);
|
||||
else {
|
||||
if ( hour >= 12 )
|
||||
watch_set_indicator(WATCH_INDICATOR_PM);
|
||||
hour = hour % 12 ? hour % 12 : 12;
|
||||
} else if ( !settings->bit.clock_24h_leading_zero ) {
|
||||
watch_set_indicator(WATCH_INDICATOR_24H);
|
||||
} else if ( hour < 10 ) {
|
||||
set_leading_zero = true;
|
||||
}
|
||||
|
||||
if ( state->mode )
|
||||
@@ -57,8 +54,6 @@ void _wake_face_update_display(movement_settings_t *settings, wake_face_state_t
|
||||
|
||||
watch_set_colon();
|
||||
watch_display_string(lcdbuf, 0);
|
||||
if ( set_leading_zero )
|
||||
watch_display_string("0", 4);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user