screens: Add notes about using C++20 features

This commit is contained in:
Riku Isokoski 2023-02-23 23:09:27 +02:00
parent 8baa317e7e
commit 0d074ee6e9
2 changed files with 2 additions and 0 deletions

View File

@ -276,6 +276,7 @@ void WatchFaceCasioStyleG7710::Refresh() {
std::chrono::system_clock::to_time_t(std::chrono::time_point_cast<std::chrono::system_clock::duration>(currentDateTime.Get()));
tm* tmTime = std::localtime(&ttTime);
// TODO: When we start using C++20, use std::chrono::year::is_leap
int daysInCurrentYear = (year % 4 == 0 && year % 100 != 0) || year % 400 == 0 ? 366 : 365;
uint16_t daysTillEndOfYearNumber = daysInCurrentYear - dayOfYear;

View File

@ -28,6 +28,7 @@ namespace {
int MaximumDayOfMonth(uint8_t month, uint16_t year) {
switch (month) {
case 2: {
// TODO: When we start using C++20, use std::chrono::year::is_leap
if ((((year % 4) == 0) && ((year % 100) != 0)) || ((year % 400) == 0)) {
return 29;
}