Feature
- New virtual tags (WEEK, MONTH, YEAR, PARENT).
This commit is contained in:
@@ -36,6 +36,7 @@ Features
|
|||||||
specifying \uNNNN.
|
specifying \uNNNN.
|
||||||
+ Now requires libuuid (thanks to Martin Natano).
|
+ Now requires libuuid (thanks to Martin Natano).
|
||||||
+ New '_get' is a DOM accessor helper command.
|
+ New '_get' is a DOM accessor helper command.
|
||||||
|
+ New virtual tags (WEEK, MONTH, YEAR, PARENT).
|
||||||
|
|
||||||
Bugs
|
Bugs
|
||||||
+ #1196 Now builds on Hurd (thanks to Jakub Wilk).
|
+ #1196 Now builds on Hurd (thanks to Jakub Wilk).
|
||||||
@@ -89,7 +90,7 @@ Features
|
|||||||
+ Removed deprecated 'fg:' and 'bg:' attributes.
|
+ Removed deprecated 'fg:' and 'bg:' attributes.
|
||||||
+ The 'diagnostics' command now reports libuuid details.
|
+ The 'diagnostics' command now reports libuuid details.
|
||||||
+ New characters for parsing and formating dates ('n', 's' and 'v').
|
+ New characters for parsing and formating dates ('n', 's' and 'v').
|
||||||
+ Virtual tags (BLOCKED, UNBLOCKED, BLOCKING, DUE, DUETODAY, TODAY, OVERDUE,
|
+ Virtual tags (BLOCKED, UNBLOCKED, BLOCKING, DUE, DUETODAY, OVERDUE, TODAY,
|
||||||
ACTIVE, SCHEDULED, CHILD, UNTIL, WAITING and ANNOTATED).
|
ACTIVE, SCHEDULED, CHILD, UNTIL, WAITING and ANNOTATED).
|
||||||
+ New 'modified' attribute, which contains the most recent modification date,
|
+ New 'modified' attribute, which contains the most recent modification date,
|
||||||
if a modification has occurred.
|
if a modification has occurred.
|
||||||
|
|||||||
1
NEWS
1
NEWS
@@ -8,6 +8,7 @@ New Features in taskwarrior 2.3.0
|
|||||||
- UDA fields now allow default values.
|
- UDA fields now allow default values.
|
||||||
- Now requires libuuid.
|
- Now requires libuuid.
|
||||||
- New '_get' DOM accessor helper command.
|
- New '_get' DOM accessor helper command.
|
||||||
|
- New virtual tags: WEEK, MONTH, YEAR, PARENT.
|
||||||
|
|
||||||
New commands in taskwarrior 2.3.0
|
New commands in taskwarrior 2.3.0
|
||||||
|
|
||||||
|
|||||||
@@ -588,9 +588,13 @@ are:
|
|||||||
DUE Matches if the task is due
|
DUE Matches if the task is due
|
||||||
DUETODAY Matches if the task is due today
|
DUETODAY Matches if the task is due today
|
||||||
TODAY Matches if the task is due today
|
TODAY Matches if the task is due today
|
||||||
|
WEEK Matches if the task is due this week
|
||||||
|
MONTH Matches if the task is due this month
|
||||||
|
YEAR Matches if the task is due this year
|
||||||
OVERDUE Matches if the task is overdue
|
OVERDUE Matches if the task is overdue
|
||||||
ACTIVE Matches if the task is started
|
ACTIVE Matches if the task is started
|
||||||
SCHEDULED Matches if the task is scheduled
|
SCHEDULED Matches if the task is scheduled
|
||||||
|
PARENT Matches if the task is a parent
|
||||||
CHILD Matches if the task has a parent
|
CHILD Matches if the task has a parent
|
||||||
UNTIL Matches if the task expires
|
UNTIL Matches if the task expires
|
||||||
WAITING Matches if the task is waiting
|
WAITING Matches if the task is waiting
|
||||||
|
|||||||
71
src/Task.cpp
71
src/Task.cpp
@@ -361,6 +361,68 @@ bool Task::is_duetoday () const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
bool Task::is_dueweek () const
|
||||||
|
{
|
||||||
|
if (has ("due"))
|
||||||
|
{
|
||||||
|
Task::status status = getStatus ();
|
||||||
|
|
||||||
|
if (status != Task::completed &&
|
||||||
|
status != Task::deleted)
|
||||||
|
{
|
||||||
|
Date now;
|
||||||
|
Date due (get_date ("due"));
|
||||||
|
if (now.year () == due.year () &&
|
||||||
|
now.week () == due.week ())
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
bool Task::is_duemonth () const
|
||||||
|
{
|
||||||
|
if (has ("due"))
|
||||||
|
{
|
||||||
|
Task::status status = getStatus ();
|
||||||
|
|
||||||
|
if (status != Task::completed &&
|
||||||
|
status != Task::deleted)
|
||||||
|
{
|
||||||
|
Date now;
|
||||||
|
Date due (get_date ("due"));
|
||||||
|
if (now.year () == due.year () &&
|
||||||
|
now.month () == due.month ())
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
bool Task::is_dueyear () const
|
||||||
|
{
|
||||||
|
if (has ("due"))
|
||||||
|
{
|
||||||
|
Task::status status = getStatus ();
|
||||||
|
|
||||||
|
if (status != Task::completed &&
|
||||||
|
status != Task::deleted)
|
||||||
|
{
|
||||||
|
Date now;
|
||||||
|
Date due (get_date ("due"));
|
||||||
|
if (now.year () == due.year ())
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
bool Task::is_overdue () const
|
bool Task::is_overdue () const
|
||||||
{
|
{
|
||||||
@@ -1026,6 +1088,9 @@ bool Task::hasTag (const std::string& tag) const
|
|||||||
if (tag == "DUETODAY") return is_duetoday ();
|
if (tag == "DUETODAY") return is_duetoday ();
|
||||||
if (tag == "TODAY") return is_duetoday ();
|
if (tag == "TODAY") return is_duetoday ();
|
||||||
if (tag == "OVERDUE") return is_overdue ();
|
if (tag == "OVERDUE") return is_overdue ();
|
||||||
|
if (tag == "WEEK") return is_dueweek ();
|
||||||
|
if (tag == "MONTH") return is_duemonth ();
|
||||||
|
if (tag == "YEAR") return is_dueyear ();
|
||||||
#endif
|
#endif
|
||||||
if (tag == "ACTIVE") return has ("start");
|
if (tag == "ACTIVE") return has ("start");
|
||||||
if (tag == "SCHEDULED") return has ("scheduled");
|
if (tag == "SCHEDULED") return has ("scheduled");
|
||||||
@@ -1033,16 +1098,12 @@ bool Task::hasTag (const std::string& tag) const
|
|||||||
if (tag == "UNTIL") return has ("until");
|
if (tag == "UNTIL") return has ("until");
|
||||||
if (tag == "WAITING") return has ("wait");
|
if (tag == "WAITING") return has ("wait");
|
||||||
if (tag == "ANNOTATED") return hasAnnotations ();
|
if (tag == "ANNOTATED") return hasAnnotations ();
|
||||||
|
if (tag == "PARENT") return has ("mask");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
TODO YESTERDAY - due yesterday
|
TODO YESTERDAY - due yesterday
|
||||||
TODO TOMORROW - due tomorrow
|
TODO TOMORROW - due tomorrow
|
||||||
TODO WEEK - due this week
|
|
||||||
TODO MONTH - due this month
|
|
||||||
TODO YEAR - due this year
|
|
||||||
TODO READY - is ready
|
TODO READY - is ready
|
||||||
TODO WAITING - is waiting
|
|
||||||
TODO PARENT - is a parent
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Concrete tags.
|
// Concrete tags.
|
||||||
|
|||||||
@@ -106,6 +106,9 @@ public:
|
|||||||
#ifdef PRODUCT_TASKWARRIOR
|
#ifdef PRODUCT_TASKWARRIOR
|
||||||
bool is_due () const;
|
bool is_due () const;
|
||||||
bool is_duetoday () const;
|
bool is_duetoday () const;
|
||||||
|
bool is_dueweek () const;
|
||||||
|
bool is_duemonth () const;
|
||||||
|
bool is_dueyear () const;
|
||||||
bool is_overdue () const;
|
bool is_overdue () const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user