From 8baa317e7e5de0e8358b9a604a96620ed24b3bf8 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Thu, 23 Feb 2023 20:00:58 +0200 Subject: date: Remove date lib DateTimeController can provide everything we need. --- src/displayapp/screens/WatchFaceDigital.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'src/displayapp/screens/WatchFaceDigital.cpp') 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 #include #include #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(newDateTime); - auto time = date::make_time(newDateTime - dp); - auto yearMonthDay = date::year_month_day(dp); - - auto year = static_cast(yearMonthDay.year()); - auto month = static_cast(static_cast(yearMonthDay.month())); - auto day = static_cast(yearMonthDay.day()); - auto dayOfWeek = static_cast(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; -- cgit v1.2.3-70-g09d2