diff options
| author | JF <jf@codingfield.com> | 2021-09-02 18:35:56 (GMT) |
|---|---|---|
| committer | Gitea <gitea@fake.local> | 2021-09-02 18:35:56 (GMT) |
| commit | 6c3d6fb2575888e582e7ef3004a0bc3bf6c588b6 (patch) | |
| tree | ac396c060b423dd98fd915e742c14fc457a6f6d9 /src/components/datetime | |
| parent | db6a701644116932f11c54ee0f619464de9faeb7 (diff) | |
| parent | 6f9f0e8b0e42a5526d47ca664534fb6b0ccb6ace (diff) | |
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/components/datetime')
| -rw-r--r-- | src/components/datetime/DateTimeController.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/components/datetime/DateTimeController.cpp b/src/components/datetime/DateTimeController.cpp index 28a70ab..d6aa83c 100644 --- a/src/components/datetime/DateTimeController.cpp +++ b/src/components/datetime/DateTimeController.cpp @@ -55,9 +55,9 @@ void DateTime::UpdateTime(uint32_t systickCounter) { auto time = date::make_time(currentDateTime - dp); auto yearMonthDay = date::year_month_day(dp); - year = (int) yearMonthDay.year(); - month = static_cast<Months>((unsigned) yearMonthDay.month()); - day = (unsigned) yearMonthDay.day(); + year = static_cast<int>(yearMonthDay.year()); + month = static_cast<Months>(static_cast<unsigned>(yearMonthDay.month())); + day = static_cast<unsigned>(yearMonthDay.day()); dayOfWeek = static_cast<Days>(date::weekday(yearMonthDay).iso_encoding()); hour = time.hours().count(); @@ -75,31 +75,31 @@ void DateTime::UpdateTime(uint32_t systickCounter) { } const char* DateTime::MonthShortToString() { - return DateTime::MonthsString[(uint8_t) month]; + return DateTime::MonthsString[static_cast<uint8_t>(month)]; } const char* DateTime::MonthShortToStringLow() { - return DateTime::MonthsStringLow[(uint8_t) month]; + return DateTime::MonthsStringLow[static_cast<uint8_t>(month)]; } const char* DateTime::MonthsToStringLow() { - return DateTime::MonthsLow[(uint8_t) month]; + return DateTime::MonthsLow[static_cast<uint8_t>(month)]; } const char* DateTime::DayOfWeekToString() { - return DateTime::DaysString[(uint8_t) dayOfWeek]; + return DateTime::DaysString[static_cast<uint8_t>(dayOfWeek)]; } const char* DateTime::DayOfWeekShortToString() { - return DateTime::DaysStringShort[(uint8_t) dayOfWeek]; + return DateTime::DaysStringShort[static_cast<uint8_t>(dayOfWeek)]; } const char* DateTime::DayOfWeekToStringLow() { - return DateTime::DaysStringLow[(uint8_t) dayOfWeek]; + return DateTime::DaysStringLow[static_cast<uint8_t>(dayOfWeek)]; } const char* DateTime::DayOfWeekShortToStringLow() { - return DateTime::DaysStringShortLow[(uint8_t) dayOfWeek]; + return DateTime::DaysStringShortLow[static_cast<uint8_t>(dayOfWeek)]; } void DateTime::Register(Pinetime::System::SystemTask* systemTask) { |
