mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-26 15:47:19 +02:00
Task: Added QUARTER virtual tag
This commit is contained in:
parent
8e8e0201f0
commit
62944cdf6f
2 changed files with 21 additions and 0 deletions
20
src/Task.cpp
20
src/Task.cpp
|
@ -474,6 +474,25 @@ bool Task::is_duemonth () const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
bool Task::is_duequarter () const
|
||||||
|
{
|
||||||
|
if (has ("due"))
|
||||||
|
{
|
||||||
|
Task::status status = getStatus ();
|
||||||
|
|
||||||
|
if (status != Task::completed &&
|
||||||
|
status != Task::deleted)
|
||||||
|
{
|
||||||
|
ISO8601d due (get_date ("due"));
|
||||||
|
if (due.sameQuarter (ISO8601d ()))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
bool Task::is_dueyear () const
|
bool Task::is_dueyear () const
|
||||||
{
|
{
|
||||||
|
@ -1235,6 +1254,7 @@ bool Task::hasTag (const std::string& tag) const
|
||||||
if (tag == "OVERDUE") return is_overdue ();
|
if (tag == "OVERDUE") return is_overdue ();
|
||||||
if (tag == "WEEK") return is_dueweek ();
|
if (tag == "WEEK") return is_dueweek ();
|
||||||
if (tag == "MONTH") return is_duemonth ();
|
if (tag == "MONTH") return is_duemonth ();
|
||||||
|
if (tag == "QUARTER") return is_duequarter ();
|
||||||
if (tag == "YEAR") return is_dueyear ();
|
if (tag == "YEAR") return is_dueyear ();
|
||||||
#endif
|
#endif
|
||||||
if (tag == "ACTIVE") return has ("start");
|
if (tag == "ACTIVE") return has ("start");
|
||||||
|
|
|
@ -107,6 +107,7 @@ public:
|
||||||
bool is_duetomorrow () const;
|
bool is_duetomorrow () const;
|
||||||
bool is_dueweek () const;
|
bool is_dueweek () const;
|
||||||
bool is_duemonth () const;
|
bool is_duemonth () const;
|
||||||
|
bool is_duequarter () const;
|
||||||
bool is_dueyear () const;
|
bool is_dueyear () const;
|
||||||
bool is_overdue () const;
|
bool is_overdue () const;
|
||||||
bool is_udaPresent () const;
|
bool is_udaPresent () const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue