Tidy time/date updates

This commit is contained in:
RandyTheSilly committed 2026-10-31 14:04:34 -04:00
1 parent 20b64afe4c
commit 938dcbbd55
1 file changed
+5 -2
+5 -2
View File
@@ -174,17 +174,20 @@ static void update_minute_60_out_handler(Animation *animation, bool finished, vo
} }
static void minute_handler(struct tm *tick_time, TimeUnits units_changed) { static void minute_handler(struct tm *tick_time, TimeUnits units_changed) {
// time/date updates // time update
static char s_time_buffer[8]; static char s_time_buffer[8];
strftime(s_time_buffer, sizeof(s_time_buffer), clock_is_24h_style() ? "%H:%M" : "%I:%M", tick_time); strftime(s_time_buffer, sizeof(s_time_buffer), clock_is_24h_style() ? "%H:%M" : "%I:%M", tick_time);
text_layer_set_text(s_time_layer, s_time_buffer);
// date update
static char s_date_buffer[16]; static char s_date_buffer[16];
#if PBL_DISPLAY_WIDTH <= 144 #if PBL_DISPLAY_WIDTH <= 144
strftime(s_date_buffer, sizeof(s_date_buffer), "%m%d", tick_time); strftime(s_date_buffer, sizeof(s_date_buffer), "%m%d", tick_time);
#else #else
strftime(s_date_buffer, sizeof(s_date_buffer), "%m.%d", tick_time); strftime(s_date_buffer, sizeof(s_date_buffer), "%m.%d", tick_time);
#endif #endif
text_layer_set_text(s_time_layer, s_time_buffer);
text_layer_set_text(s_date_layer, s_date_buffer); text_layer_set_text(s_date_layer, s_date_buffer);
// create date/bt centering animations // create date/bt centering animations
//// count "1"s in s_time_buffer //// count "1"s in s_time_buffer
static uint8_t ones; static uint8_t ones;