mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
Code Cleanup
- Migrated the recur.cpp getDueState() function into Task::getDateState(), which can assess any date attribute. - Improved implementation to distinguish between: - not due, or not due for rc.due days - due after today - due later today - due earlier today - due before today This greater precision should address some outstanding issues.
This commit is contained in:
parent
5706cca207
commit
c933ed2cf7
6 changed files with 68 additions and 88 deletions
|
@ -222,7 +222,7 @@ static void colorizeDue (Task& task, const Color& base, Color& c)
|
|||
Task::status status = task.getStatus ();
|
||||
if (status != Task::completed &&
|
||||
status != Task::deleted &&
|
||||
getDueState (task.get ("due")) == 1)
|
||||
task.getDateState ("due") == Task::dateAfterToday)
|
||||
c.blend (base);
|
||||
}
|
||||
}
|
||||
|
@ -233,9 +233,10 @@ static void colorizeDueToday (Task& task, const Color& base, Color& c)
|
|||
if (task.has ("due"))
|
||||
{
|
||||
Task::status status = task.getStatus ();
|
||||
Task::dateState dateState = task.getDateState ("due");
|
||||
if (status != Task::completed &&
|
||||
status != Task::deleted &&
|
||||
getDueState (task.get ("due")) == 2)
|
||||
(dateState == Task::dateLaterToday || dateState == Task::dateEarlierToday))
|
||||
c.blend (base);
|
||||
}
|
||||
}
|
||||
|
@ -248,7 +249,7 @@ static void colorizeOverdue (Task& task, const Color& base, Color& c)
|
|||
Task::status status = task.getStatus ();
|
||||
if (status != Task::completed &&
|
||||
status != Task::deleted &&
|
||||
getDueState (task.get ("due")) == 3)
|
||||
task.getDateState ("due") == Task::dateBeforeToday)
|
||||
c.blend (base);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue