mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +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
|
@ -561,23 +561,24 @@ std::string CmdCalendar::renderMonths (
|
|||
duedmy.month () == months[mpl] &&
|
||||
duedmy.year () == years[mpl])
|
||||
{
|
||||
switch (getDueState (due))
|
||||
switch (task->getDateState ("due"))
|
||||
{
|
||||
case 1: // imminent
|
||||
cellColor.blend (color_due);
|
||||
break;
|
||||
case Task::dateNotDue:
|
||||
break;
|
||||
|
||||
case 2: // today
|
||||
cellColor.blend (color_duetoday);
|
||||
break;
|
||||
case Task::dateAfterToday:
|
||||
cellColor.blend (color_due);
|
||||
break;
|
||||
|
||||
case 3: // overdue
|
||||
cellColor.blend (color_overdue);
|
||||
break;
|
||||
case Task::dateEarlierToday:
|
||||
case Task::dateLaterToday:
|
||||
cellColor.blend (color_duetoday);
|
||||
cellColor.blend (color_duetoday);
|
||||
break;
|
||||
|
||||
case 0: // not due at all
|
||||
default:
|
||||
break;
|
||||
case Task::dateBeforeToday:
|
||||
cellColor.blend (color_overdue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue