mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Date
- Implemented Date::dayOfYear which yields a number, 1 to 366.
This commit is contained in:
parent
b4be5991b8
commit
27752bd510
3 changed files with 15 additions and 2 deletions
|
@ -34,7 +34,7 @@ Context context;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
UnitTest t (165);
|
||||
UnitTest t (168);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -242,6 +242,11 @@ int main (int argc, char** argv)
|
|||
t.is (fromString13.minute (), 34, "ctor (std::string) -> N");
|
||||
t.is (fromString13.second (), 56, "ctor (std::string) -> S");
|
||||
|
||||
// Day of year
|
||||
t.is (Date ("1/1/2011", "m/d/Y").dayOfYear (), 1, "dayOfYear (1/1/2011) -> 1");
|
||||
t.is (Date ("5/1/2011", "m/d/Y").dayOfYear (), 121, "dayOfYear (5/1/2011) -> 121");
|
||||
t.is (Date ("12/31/2011", "m/d/Y").dayOfYear (), 365, "dayOfYear (12/31/2011) -> 365");
|
||||
|
||||
// Easter
|
||||
Date e1 (Date::easter(1980));
|
||||
t.is (e1.toString (), "4/6/1980", "Easter 4/6/1980");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue