mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Task: Added QUARTER virtual tag
This commit is contained in:
parent
fd69305ad3
commit
630a1530e0
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;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
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
|
||||
{
|
||||
|
@ -1235,6 +1254,7 @@ bool Task::hasTag (const std::string& tag) const
|
|||
if (tag == "OVERDUE") return is_overdue ();
|
||||
if (tag == "WEEK") return is_dueweek ();
|
||||
if (tag == "MONTH") return is_duemonth ();
|
||||
if (tag == "QUARTER") return is_duequarter ();
|
||||
if (tag == "YEAR") return is_dueyear ();
|
||||
#endif
|
||||
if (tag == "ACTIVE") return has ("start");
|
||||
|
|
|
@ -107,6 +107,7 @@ public:
|
|||
bool is_duetomorrow () const;
|
||||
bool is_dueweek () const;
|
||||
bool is_duemonth () const;
|
||||
bool is_duequarter () const;
|
||||
bool is_dueyear () const;
|
||||
bool is_overdue () const;
|
||||
bool is_udaPresent () const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue