screens: Add notes about using C++20 features
This commit is contained in:
parent
8baa317e7e
commit
0d074ee6e9
|
@ -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()));
|
std::chrono::system_clock::to_time_t(std::chrono::time_point_cast<std::chrono::system_clock::duration>(currentDateTime.Get()));
|
||||||
tm* tmTime = std::localtime(&ttTime);
|
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;
|
int daysInCurrentYear = (year % 4 == 0 && year % 100 != 0) || year % 400 == 0 ? 366 : 365;
|
||||||
uint16_t daysTillEndOfYearNumber = daysInCurrentYear - dayOfYear;
|
uint16_t daysTillEndOfYearNumber = daysInCurrentYear - dayOfYear;
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ namespace {
|
||||||
int MaximumDayOfMonth(uint8_t month, uint16_t year) {
|
int MaximumDayOfMonth(uint8_t month, uint16_t year) {
|
||||||
switch (month) {
|
switch (month) {
|
||||||
case 2: {
|
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)) {
|
if ((((year % 4) == 0) && ((year % 100) != 0)) || ((year % 400) == 0)) {
|
||||||
return 29;
|
return 29;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user