mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Merge branch '2.0.0' of tasktools.org:task into 2.0.0
This commit is contained in:
commit
3e5bb713eb
5 changed files with 59 additions and 3 deletions
40
src/Date.cpp
40
src/Date.cpp
|
@ -58,11 +58,13 @@ static const char* relatives[] =
|
|||
"eoww",
|
||||
"eocw",
|
||||
"eom",
|
||||
"eoq",
|
||||
"eoy",
|
||||
"sow",
|
||||
"soww",
|
||||
"socw",
|
||||
"som",
|
||||
"soq",
|
||||
"soy",
|
||||
"goodfriday",
|
||||
"easter",
|
||||
|
@ -877,6 +879,25 @@ bool Date::isRelativeDate (const std::string& input)
|
|||
mT = then.mT;
|
||||
return true;
|
||||
}
|
||||
else if (found == "eoq")
|
||||
{
|
||||
int m = today.month ();
|
||||
int y = today.year ();
|
||||
int q;
|
||||
if (m <= 3)
|
||||
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);
|
||||
mT = then.mT;
|
||||
return true;
|
||||
}
|
||||
else if (found == "eoy")
|
||||
{
|
||||
Date then (12, 31, today.year ());
|
||||
|
@ -896,6 +917,25 @@ bool Date::isRelativeDate (const std::string& input)
|
|||
mT = then.mT;
|
||||
return true;
|
||||
}
|
||||
else if (found == "soq")
|
||||
{
|
||||
int m = today.month ();
|
||||
int y = today.year ();
|
||||
int q;
|
||||
if (m <= 3)
|
||||
q = 1;
|
||||
else if (m >= 4 && m <= 6)
|
||||
q = 4;
|
||||
else if (m >= 7 && m <= 9)
|
||||
q = 7;
|
||||
else
|
||||
q = 10;
|
||||
Date then (q,
|
||||
1,
|
||||
y);
|
||||
mT = then.mT;
|
||||
return true;
|
||||
}
|
||||
else if (found == "soy")
|
||||
{
|
||||
Date then (1, 1, today.year () + 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue