From 11ade64166c8900abb5574dd9d4aa2ae597f69c5 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Fri, 3 Mar 2023 12:20:18 +0200 Subject: WatchFaceAnalog: Simplify date update check --- src/displayapp/screens/WatchFaceAnalog.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/displayapp/screens/WatchFaceAnalog.cpp') 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()); } } } -- cgit v1.2.3-70-g09d2