ISO8601d: Added ::startOfWeek

This commit is contained in:
Paul Beckingham 2015-09-26 16:12:48 -04:00
parent a6331747d2
commit 25c4f8871e
2 changed files with 9 additions and 0 deletions

View file

@ -846,6 +846,14 @@ ISO8601d ISO8601d::startOfDay () const
return ISO8601d (month (), day (), year ());
}
////////////////////////////////////////////////////////////////////////////////
ISO8601d ISO8601d::startOfWeek () const
{
ISO8601d sow (_date);
sow -= (dayOfWeek () * 86400);
return ISO8601d (sow.month (), sow.day (), sow.year ());
}
////////////////////////////////////////////////////////////////////////////////
// Static
bool ISO8601d::leapYear (int year)