Merge branch 'feature/#757-Add-time-date-classes' of https://github.com/ETLCPP/etl into feature/#757-Add-time-date-classes

This commit is contained in:
John Wellbelove 2023-09-17 19:49:56 +01:00
commit 501a73a9b7
2 changed files with 24 additions and 0 deletions

View File

@ -187,6 +187,14 @@ namespace etl
private:
//***********************************************************************
/// Normalise to a in-range month
//***********************************************************************
ETL_NODISCARD ETL_CONSTEXPR void normalise()
{
value = ((value % 12U) == 0U) ? 12U : value;
}
unsigned char value;
};

View File

@ -209,8 +209,24 @@ namespace etl
// std::chrono::weekday_last();
//}
//***********************************************************************
/// Returns <b>true</b> if the day is a weekend.
//***********************************************************************
ETL_NODISCARD ETL_CONSTEXPR14 bool is_weekend()
{
return (c_encoding() == 0U) || (c_encoding() == 6U);
}
private:
//***********************************************************************
/// Normalise to a in-range weekday
//***********************************************************************
ETL_NODISCARD ETL_CONSTEXPR void normalise()
{
value %= 7U;
}
unsigned char value;
};