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/WatchFaceInfineat.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'src/displayapp/screens/WatchFaceInfineat.cpp') diff --git a/src/displayapp/screens/WatchFaceInfineat.cpp b/src/displayapp/screens/WatchFaceInfineat.cpp index 6bd16430..6e854654 100644 --- a/src/displayapp/screens/WatchFaceInfineat.cpp +++ b/src/displayapp/screens/WatchFaceInfineat.cpp @@ -1,6 +1,5 @@ #include "displayapp/screens/WatchFaceInfineat.h" -#include #include #include #include "displayapp/screens/Symbols.h" @@ -314,19 +313,12 @@ void WatchFaceInfineat::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()); - - int hour = time.hours().count(); - auto 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(); char minutesChar[3]; sprintf(minutesChar, "%02d", static_cast(minute)); -- cgit v1.2.3-70-g09d2