aboutsummaryrefslogtreecommitdiffstats
path: root/src/displayapp/screens/WatchFaceInfineat.cpp
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2023-02-23 20:00:58 +0200
committerRiku Isokoski <riksu9000@gmail.com>2023-02-25 17:44:06 +0200
commit8baa317e7e5de0e8358b9a604a96620ed24b3bf8 (patch)
tree3d95843b53c9232401c75e5a251bd76f46a931ab /src/displayapp/screens/WatchFaceInfineat.cpp
parent959778d770aedb56d773e7fde07c8c967d5b35eb (diff)
date: Remove date lib
DateTimeController can provide everything we need.
Diffstat (limited to 'src/displayapp/screens/WatchFaceInfineat.cpp')
-rw-r--r--src/displayapp/screens/WatchFaceInfineat.cpp20
1 files changed, 6 insertions, 14 deletions
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 <date/date.h>
#include <lvgl/lvgl.h>
#include <cstdio>
#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<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());
-
- 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<int>(minute));