mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Feature TW-1260
- TW-1260 New virtual tags YESTERDAY, TOMORROW.
This commit is contained in:
parent
1170a43f6b
commit
b9c853fece
5 changed files with 44 additions and 6 deletions
|
@ -10,6 +10,7 @@ Features
|
||||||
+ TW-261 Easy to create "not deletable" task (thanks to Jan Kunder).
|
+ TW-261 Easy to create "not deletable" task (thanks to Jan Kunder).
|
||||||
+ TW-1255 New testing framework (thanks to Renato Alves).
|
+ TW-1255 New testing framework (thanks to Renato Alves).
|
||||||
+ TW-1258 Portuguese Localization (thanks to Renato Alves).
|
+ TW-1258 Portuguese Localization (thanks to Renato Alves).
|
||||||
|
+ TW-1260 New virtual tags YESTERDAY, TOMORROW.
|
||||||
+ Removed deprecated 'echo.command' setting, in favor of the 'header' and
|
+ Removed deprecated 'echo.command' setting, in favor of the 'header' and
|
||||||
'affected' verbosity tokens.
|
'affected' verbosity tokens.
|
||||||
+ Removed deprecated 'edit.verbose' setting, in favor of the 'edit' verbosity
|
+ Removed deprecated 'edit.verbose' setting, in favor of the 'edit' verbosity
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -5,6 +5,7 @@ New Features in taskwarrior 2.4.0
|
||||||
- Removed deprecated commands 'push', 'pull' and 'merge'.
|
- Removed deprecated commands 'push', 'pull' and 'merge'.
|
||||||
- Portuguese (por-PRT) localization.
|
- Portuguese (por-PRT) localization.
|
||||||
- Better handling for deletion of recurring tasks.
|
- Better handling for deletion of recurring tasks.
|
||||||
|
- New virtual tags: YESTERDAY, TOMORROW.
|
||||||
|
|
||||||
New commands in taskwarrior 2.4.0
|
New commands in taskwarrior 2.4.0
|
||||||
|
|
||||||
|
|
|
@ -571,9 +571,11 @@ are:
|
||||||
BLOCKED Matches if the task is blocked
|
BLOCKED Matches if the task is blocked
|
||||||
UNBLOCKED Matches if the task is not blocked
|
UNBLOCKED Matches if the task is not blocked
|
||||||
BLOCKING Matches if the task is blocking
|
BLOCKING Matches if the task is blocking
|
||||||
|
YESTERDAY Matches if the task was due sometime yesterday
|
||||||
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
|
||||||
|
TOMORROW Matches if the task is due sometime tomorrow
|
||||||
WEEK Matches if the task is due this week
|
WEEK Matches if the task is due this week
|
||||||
MONTH Matches if the task is due this month
|
MONTH Matches if the task is due this month
|
||||||
YEAR Matches if the task is due this year
|
YEAR Matches if the task is due this year
|
||||||
|
|
44
src/Task.cpp
44
src/Task.cpp
|
@ -342,6 +342,24 @@ bool Task::is_due () const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
bool Task::is_dueyesterday () const
|
||||||
|
{
|
||||||
|
if (has ("due"))
|
||||||
|
{
|
||||||
|
Task::status status = getStatus ();
|
||||||
|
|
||||||
|
if (status != Task::completed &&
|
||||||
|
status != Task::deleted)
|
||||||
|
{
|
||||||
|
if (Date ("yesterday").sameDay (get_date ("due")))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
bool Task::is_duetoday () const
|
bool Task::is_duetoday () const
|
||||||
{
|
{
|
||||||
|
@ -360,6 +378,24 @@ bool Task::is_duetoday () const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
bool Task::is_duetomorrow () const
|
||||||
|
{
|
||||||
|
if (has ("due"))
|
||||||
|
{
|
||||||
|
Task::status status = getStatus ();
|
||||||
|
|
||||||
|
if (status != Task::completed &&
|
||||||
|
status != Task::deleted)
|
||||||
|
{
|
||||||
|
if (Date ("tomorrow").sameDay (get_date ("due")))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
bool Task::is_dueweek () const
|
bool Task::is_dueweek () const
|
||||||
{
|
{
|
||||||
|
@ -1081,6 +1117,8 @@ bool Task::hasTag (const std::string& tag) const
|
||||||
if (tag == "DUE") return is_due ();
|
if (tag == "DUE") return is_due ();
|
||||||
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 == "YESTERDAY") return is_dueyesterday ();
|
||||||
|
if (tag == "TOMORROW") return is_duetomorrow ();
|
||||||
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 ();
|
||||||
|
@ -1094,12 +1132,6 @@ bool Task::hasTag (const std::string& tag) const
|
||||||
if (tag == "ANNOTATED") return hasAnnotations ();
|
if (tag == "ANNOTATED") return hasAnnotations ();
|
||||||
if (tag == "PARENT") return has ("mask");
|
if (tag == "PARENT") return has ("mask");
|
||||||
|
|
||||||
/*
|
|
||||||
TODO YESTERDAY - due yesterday
|
|
||||||
TODO TOMORROW - due tomorrow
|
|
||||||
TODO READY - is ready
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Concrete tags.
|
// Concrete tags.
|
||||||
std::vector <std::string> tags;
|
std::vector <std::string> tags;
|
||||||
split (tags, get ("tags"), ',');
|
split (tags, get ("tags"), ',');
|
||||||
|
|
|
@ -104,7 +104,9 @@ public:
|
||||||
|
|
||||||
#ifdef PRODUCT_TASKWARRIOR
|
#ifdef PRODUCT_TASKWARRIOR
|
||||||
bool is_due () const;
|
bool is_due () const;
|
||||||
|
bool is_dueyesterday () const;
|
||||||
bool is_duetoday () const;
|
bool is_duetoday () const;
|
||||||
|
bool is_duetomorrow () const;
|
||||||
bool is_dueweek () const;
|
bool is_dueweek () const;
|
||||||
bool is_duemonth () const;
|
bool is_duemonth () const;
|
||||||
bool is_dueyear () const;
|
bool is_dueyear () const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue