Task: Added QUARTER virtual tag
This commit is contained in:
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;
|
||||||
|
|||||||
Reference in New Issue
Block a user