eliminate char variabe

This commit is contained in:
Josh 2024-05-20 21:15:08 -06:00
parent c34fbf9ff6
commit 98dfee90fa

View File

@ -140,34 +140,33 @@ void WatchFaceGravel::Refresh() {
if (currentDate.IsUpdated()) { if (currentDate.IsUpdated()) {
Controllers::DateTime::Days dayOfWeek = dateTimeController.DayOfWeek(); Controllers::DateTime::Days dayOfWeek = dateTimeController.DayOfWeek();
lv_label_set_text_fmt(labelDate, "%s %d %s", dateTimeController.DayOfWeekShortToStringLow(dayOfWeek), dateTimeController.Day(), dateTimeController.MonthShortToString()); lv_label_set_text_fmt(labelDate, "%s %d %s", dateTimeController.DayOfWeekShortToStringLow(dayOfWeek), dateTimeController.Day(), dateTimeController.MonthShortToString());
char dayChar = ' ';
switch(dateTimeController.DayOfWeek()) { switch(dateTimeController.DayOfWeek()) {
case (Controllers::DateTime::Days::Sunday): case (Controllers::DateTime::Days::Sunday):
dayChar = 'S'; lv_label_set_text_fmt(labelDate, "S %d %s", dateTimeController.Day(), dateTimeController.MonthShortToString());
break; break;
case (Controllers::DateTime::Days::Monday): case (Controllers::DateTime::Days::Monday):
dayChar = 'M'; lv_label_set_text_fmt(labelDate, "M %d %s", dateTimeController.Day(), dateTimeController.MonthShortToString());
break; break;
case (Controllers::DateTime::Days::Tuesday): case (Controllers::DateTime::Days::Tuesday):
dayChar = 'T'; lv_label_set_text_fmt(labelDate, "T %d %s", dateTimeController.Day(), dateTimeController.MonthShortToString());
break; break;
case (Controllers::DateTime::Days::Wednesday): case (Controllers::DateTime::Days::Wednesday):
dayChar = 'W'; lv_label_set_text_fmt(labelDate, "W %d %s", dateTimeController.Day(), dateTimeController.MonthShortToString());
break; break;
case (Controllers::DateTime::Days::Thursday): case (Controllers::DateTime::Days::Thursday):
dayChar = 'R'; lv_label_set_text_fmt(labelDate, "R %d %s", dateTimeController.Day(), dateTimeController.MonthShortToString());
break; break;
case (Controllers::DateTime::Days::Friday): case (Controllers::DateTime::Days::Friday):
dayChar = 'F'; lv_label_set_text_fmt(labelDate, "F %d %s", dateTimeController.Day(), dateTimeController.MonthShortToString());
break; break;
case (Controllers::DateTime::Days::Saturday): case (Controllers::DateTime::Days::Saturday):
dayChar = 'A'; lv_label_set_text_fmt(labelDate, "A %d %s", dateTimeController.Day(), dateTimeController.MonthShortToString());
break; break;
default: default:
break; break;
} }
lv_label_set_text_fmt(labelDate, "%c %d %s", dayChar, dateTimeController.Day(), dateTimeController.MonthShortToString()); //lv_label_set_text_fmt(labelDate, "%c %d %s", dayChar, dateTimeController.Day(), dateTimeController.MonthShortToString());
} }
lv_obj_realign(labelDate); lv_obj_realign(labelDate);
} }