mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 19:17:19 +02:00
Feature TW-197
- TW-197 New virtual tag READY.
This commit is contained in:
parent
b9c853fece
commit
5ca55e75cf
5 changed files with 16 additions and 1 deletions
12
src/Task.cpp
12
src/Task.cpp
|
@ -324,6 +324,17 @@ void Task::setStatus (Task::status status)
|
|||
}
|
||||
|
||||
#ifdef PRODUCT_TASKWARRIOR
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Ready means pending, not blocked and either not scheduled or scheduled before
|
||||
// now.
|
||||
bool Task::is_ready () const
|
||||
{
|
||||
return getStatus () == Task::pending &&
|
||||
!is_blocked &&
|
||||
(! has ("scheduled") ||
|
||||
Date ("now").operator> (get_date ("scheduled")));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Task::is_due () const
|
||||
{
|
||||
|
@ -1114,6 +1125,7 @@ bool Task::hasTag (const std::string& tag) const
|
|||
if (tag == "UNBLOCKED") return !is_blocked;
|
||||
if (tag == "BLOCKING") return is_blocking;
|
||||
#ifdef PRODUCT_TASKWARRIOR
|
||||
if (tag == "READY") return is_ready ();
|
||||
if (tag == "DUE") return is_due ();
|
||||
if (tag == "DUETODAY") return is_duetoday ();
|
||||
if (tag == "TODAY") return is_duetoday ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue