diff --git a/src/displayapp/screens/WatchFaceAnalog.cpp b/src/displayapp/screens/WatchFaceAnalog.cpp index ad66be15..76d01cf1 100644 --- a/src/displayapp/screens/WatchFaceAnalog.cpp +++ b/src/displayapp/screens/WatchFaceAnalog.cpp @@ -223,20 +223,12 @@ void WatchFaceAnalog::Refresh() { } currentDateTime = dateTimeController.CurrentDateTime(); - if (currentDateTime.IsUpdated()) { - Pinetime::Controllers::DateTime::Months month = dateTimeController.Month(); - uint8_t day = dateTimeController.Day(); - Pinetime::Controllers::DateTime::Days dayOfWeek = dateTimeController.DayOfWeek(); - UpdateClock(); - if ((month != currentMonth) || (dayOfWeek != currentDayOfWeek) || (day != currentDay)) { - lv_label_set_text_fmt(label_date_day, "%s\n%02i", dateTimeController.DayOfWeekShortToString(), day); - - currentMonth = month; - currentDayOfWeek = dayOfWeek; - currentDay = day; + currentDate = std::chrono::time_point_cast(currentDateTime.Get()); + if (currentDate.IsUpdated()) { + lv_label_set_text_fmt(label_date_day, "%s\n%02i", dateTimeController.DayOfWeekShortToString(), dateTimeController.Day()); } } } diff --git a/src/displayapp/screens/WatchFaceAnalog.h b/src/displayapp/screens/WatchFaceAnalog.h index cbb0b2cb..b32293da 100644 --- a/src/displayapp/screens/WatchFaceAnalog.h +++ b/src/displayapp/screens/WatchFaceAnalog.h @@ -37,15 +37,13 @@ namespace Pinetime { private: uint8_t sHour, sMinute, sSecond; - Pinetime::Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown; - Pinetime::Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown; - uint8_t currentDay = 0; - DirtyValue batteryPercentRemaining {0}; DirtyValue isCharging {}; DirtyValue bleState {}; DirtyValue> currentDateTime; DirtyValue notificationState {false}; + using days = std::chrono::duration>; // TODO: days is standard in c++20 + DirtyValue> currentDate; lv_obj_t* hour_body; lv_obj_t* hour_body_trace;