Report date format

- added new reportdateformat to extend the formatting of due dates
  in the reports and "task info"
- added new conversion sequences a, A, b, B and Y to be used with
  reportdateformat
This commit is contained in:
Federico Hernandez 2010-01-12 23:12:22 +01:00
parent e92fb9287a
commit 660d0cca3e
14 changed files with 269 additions and 52 deletions

View file

@ -34,7 +34,7 @@ Context context;
////////////////////////////////////////////////////////////////////////////////
int main (int argc, char** argv)
{
UnitTest t (102);
UnitTest t (111);
try
{
@ -180,6 +180,21 @@ int main (int argc, char** argv)
t.is (fromString7.day (), 1, "ctor (std::string) -> d");
t.is (fromString7.year (), 2008, "ctor (std::string) -> y");
Date fromString8 ("Tue 01 Jan 2008 (01)", "a D b Y (V)");
t.is (fromString8.month (), 1, "ctor (std::string) -> m");
t.is (fromString8.day (), 1, "ctor (std::string) -> d");
t.is (fromString8.year (), 2008, "ctor (std::string) -> y");
Date fromString9 ("Tuesday, January 1, 2008", "A, B d, Y");
t.is (fromString9.month (), 1, "ctor (std::string) -> m");
t.is (fromString9.day (), 1, "ctor (std::string) -> d");
t.is (fromString9.year (), 2008, "ctor (std::string) -> y");
Date fromString10 ("v01 Tue 2008-01-01", "vV a Y-M-D");
t.is (fromString10.month (), 1, "ctor (std::string) -> m");
t.is (fromString10.day (), 1, "ctor (std::string) -> d");
t.is (fromString10.year (), 2008, "ctor (std::string) -> y");
// Relative dates.
Date r1 ("today");
t.ok (r1.sameDay (now), "today = now");