mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
ISO8601d: Added ::leapYear and tests
This commit is contained in:
parent
f615db8a4c
commit
6f5d07dcd4
3 changed files with 18 additions and 1 deletions
|
@ -798,6 +798,14 @@ bool ISO8601p::parse (const std::string& input, std::string::size_type& start)
|
|||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Static
|
||||
bool ISO8601d::leapYear (int year)
|
||||
{
|
||||
return ((! (year % 4)) && (year % 100)) ||
|
||||
! (year % 400);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Static
|
||||
int ISO8601d::dayOfWeek (const std::string& input)
|
||||
|
@ -817,6 +825,7 @@ int ISO8601d::dayOfWeek (const std::string& input)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Static
|
||||
int ISO8601d::length (const std::string& format)
|
||||
{
|
||||
int len = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue