diff options
| author | Riku Isokoski <riksu9000@gmail.com> | 2023-02-23 20:00:58 +0200 |
|---|---|---|
| committer | Riku Isokoski <riksu9000@gmail.com> | 2023-02-25 17:44:06 +0200 |
| commit | 8baa317e7e5de0e8358b9a604a96620ed24b3bf8 (patch) | |
| tree | 3d95843b53c9232401c75e5a251bd76f46a931ab /src/displayapp/screens/WatchFaceDigital.cpp | |
| parent | 959778d770aedb56d773e7fde07c8c967d5b35eb (diff) | |
date: Remove date lib
DateTimeController can provide everything we need.
Diffstat (limited to 'src/displayapp/screens/WatchFaceDigital.cpp')
| -rw-r--r-- | src/displayapp/screens/WatchFaceDigital.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index d33f4b28..ad35b5c9 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -1,6 +1,5 @@ #include "displayapp/screens/WatchFaceDigital.h" -#include <date/date.h> #include <lvgl/lvgl.h> #include <cstdio> #include "displayapp/screens/NotificationIcon.h" @@ -89,19 +88,12 @@ void WatchFaceDigital::Refresh() { currentDateTime = dateTimeController.CurrentDateTime(); if (currentDateTime.IsUpdated()) { - auto newDateTime = currentDateTime.Get(); - - auto dp = date::floor<date::days>(newDateTime); - auto time = date::make_time(newDateTime - dp); - auto yearMonthDay = date::year_month_day(dp); - - auto year = static_cast<int>(yearMonthDay.year()); - auto month = static_cast<Pinetime::Controllers::DateTime::Months>(static_cast<unsigned>(yearMonthDay.month())); - auto day = static_cast<unsigned>(yearMonthDay.day()); - auto dayOfWeek = static_cast<Pinetime::Controllers::DateTime::Days>(date::weekday(yearMonthDay).iso_encoding()); - - uint8_t hour = time.hours().count(); - uint8_t minute = time.minutes().count(); + auto hour = dateTimeController.Hours(); + auto minute = dateTimeController.Minutes(); + auto year = dateTimeController.Year(); + auto month = dateTimeController.Month(); + auto dayOfWeek = dateTimeController.DayOfWeek(); + auto day = dateTimeController.Day(); if (displayedHour != hour || displayedMinute != minute) { displayedHour = hour; |
