1
0
Fork 0

DateTimeController: make possible functions const

MonthShortToString and DayOfWeekShortToString don't change the
underlying object. Those are just getters and can be declared `const`.
This commit is contained in:
Reinhold Gschweicher 2022-03-14 20:28:51 +01:00
parent 21da5869c5
commit db41d9081a
2 changed files with 4 additions and 4 deletions

View file

@ -108,11 +108,11 @@ void DateTime::UpdateTime(uint32_t systickCounter) {
}
}
const char* DateTime::MonthShortToString() {
const char* DateTime::MonthShortToString() const {
return MonthsString[static_cast<uint8_t>(month)];
}
const char* DateTime::DayOfWeekShortToString() {
const char* DateTime::DayOfWeekShortToString() const {
return DaysStringShort[static_cast<uint8_t>(dayOfWeek)];
}

View file

@ -61,8 +61,8 @@ namespace Pinetime {
return second;
}
const char* MonthShortToString();
const char* DayOfWeekShortToString();
const char* MonthShortToString() const;
const char* DayOfWeekShortToString() const;
static const char* MonthShortToStringLow(Months month);
std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> CurrentDateTime() const {