mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-26 20:38:45 +08:00
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:
commit
501a73a9b7
@ -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;
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user