Corrected code formatting

Corrected formatting and removed unnecessary variable time24H
This commit is contained in:
Eli Weiss
2022-01-11 16:23:49 -05:00
committed by JF
parent d86f81b9ad
commit 02e94acf18
2 changed files with 30 additions and 28 deletions

View File

@@ -22,6 +22,8 @@ namespace Pinetime {
Controllers::DateTime& dateTimeController;
Controllers::Settings& settingsController;
void setHourLabels();
int hoursValue;
int minutesValue;
lv_obj_t* lblHours;
@@ -32,31 +34,6 @@ namespace Pinetime {
lv_obj_t* btnMinutesPlus;
lv_obj_t* btnMinutesMinus;
lv_obj_t* btnSetTime;
void setHourLabels(int time24H) {
switch (time24H) {
if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) {
case 0:
lv_label_set_text_static(lblHours, "12");
lv_label_set_text_static(lblampm, "AM");
break;
case 1 ... 11:
lv_label_set_text_fmt(lblHours, "%02d", time24H);
lv_label_set_text_static(lblampm, "AM");
break;
case 12:
lv_label_set_text_static(lblHours, "12");
lv_label_set_text_static(lblampm, "PM");
break;
case 13 ... 23:
lv_label_set_text_fmt(lblHours, "%02d", time24H - 12);
lv_label_set_text_static(lblampm, "PM");
break;
} else {
lv_label_set_text_fmt(lblHours, "%02d", hoursValue);
}
}
}
};
}
}