Configuration Variable - due

- Added support for the "due" configuration variable that defines
  how many days into the future when a task is considered due.
This commit is contained in:
Paul Beckingham 2009-02-14 20:19:47 -05:00
parent 6faf1e44f5
commit 01b3cb190c
7 changed files with 30 additions and 12 deletions

View file

@ -80,7 +80,11 @@ void initializeColorRules (Config& conf)
}
////////////////////////////////////////////////////////////////////////////////
void autoColorize (T& task, Text::color& fg, Text::color& bg)
void autoColorize (
T& task,
Text::color& fg,
Text::color& bg,
Config& conf)
{
// Note: fg, bg already contain colors specifically assigned via command.
// Note: These rules form a hierarchy - the last rule is king.
@ -159,7 +163,7 @@ void autoColorize (T& task, Text::color& fg, Text::color& bg)
{
Date dueDate (::atoi (due.c_str ()));
Date now;
Date then (now + 7 * 86400);
Date then (now + conf.get ("due", 7) * 86400);
// Overdue
if (dueDate < now)