Task: Added QUARTER virtual tag

This commit is contained in:
Paul Beckingham 2016-05-30 14:11:07 -04:00
parent fd69305ad3
commit 630a1530e0
2 changed files with 21 additions and 0 deletions

View file

@ -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");

View file

@ -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;