- applied patch for eoq and soq (thanks to Paulo Almeida)
This commit is contained in:
Federico Hernandez 2011-09-03 16:38:26 +02:00
parent 45a07f4d85
commit 4083883ec4
2 changed files with 13 additions and 28 deletions

View file

@ -38,7 +38,6 @@
+ The configuration variable 'json.array' determines whether 'query' command + The configuration variable 'json.array' determines whether 'query' command
output is enclosed by '[...]'. output is enclosed by '[...]'.
+ The duration 'm' is now interpreted as 'months', not 'minutes'. + The duration 'm' is now interpreted as 'months', not 'minutes'.
+ New "eoq" and "soq" dates for the end and start of quarter.
# Tracked Features, sorted by ID. # Tracked Features, sorted by ID.
+ Added feature #278, which provides a more consistent command line grammar. + Added feature #278, which provides a more consistent command line grammar.
@ -96,6 +95,8 @@
controlled by '#define HAVE_EXECUTE 1' in cmake.h. This allows a build controlled by '#define HAVE_EXECUTE 1' in cmake.h. This allows a build
that does not have the potential security hole, in the event that taskwarrior that does not have the potential security hole, in the event that taskwarrior
is run at elevated privilege, or run in the context of a web server. is run at elevated privilege, or run in the context of a web server.
+ Added feature #813, new "eoq" and "soq" dates for the end and start of quarter.
(thanks to Dave French and Paulo Almeida for the patch)
# Tracked Bugs, sorted by ID. # Tracked Bugs, sorted by ID.
+ Fixed bug #403, which disambiguates certain commands involving numbers. + Fixed bug #403, which disambiguates certain commands involving numbers.

View file

@ -881,20 +881,10 @@ bool Date::isRelativeDate (const std::string& input)
} }
else if (found == "eoq") else if (found == "eoq")
{ {
int m = today.month (); int eoq_month = today.month () + 2 - (today.month () - 1) % 3;
int y = today.year (); Date then (eoq_month,
int q; daysInMonth (eoq_month, today.year ()),
if (m <= 3) today.year ());
q = 3;
else if (m >= 4 && m <= 6)
q = 6;
else if (m >= 7 && m <= 9)
q = 9;
else
q = 12;
Date then (q,
Date::daysInMonth (q, y),
y);
_t = then._t; _t = then._t;
return true; return true;
} }
@ -919,20 +909,14 @@ bool Date::isRelativeDate (const std::string& input)
} }
else if (found == "soq") else if (found == "soq")
{ {
int m = today.month (); int m = today.month () + 3 - (today.month () - 1) % 3;
int y = today.year (); int y = today.year ();
int q; if (m > 12)
if (m <= 3) {
q = 1; m -=12;
else if (m >= 4 && m <= 6) y++;
q = 4; }
else if (m >= 7 && m <= 9) Date then (m , 1, y);
q = 7;
else
q = 10;
Date then (q,
1,
y);
_t = then._t; _t = then._t;
return true; return true;
} }