Calendar coloring
- Now all due tasks are colorized. - Setting due=0 now colorizes all due tasks in reports.
This commit is contained in:
@@ -385,13 +385,18 @@ int getDueState (const std::string& due)
|
||||
|
||||
// rightNow is the current date + time.
|
||||
Date rightNow;
|
||||
Date midnight (rightNow.month (), rightNow.day (), rightNow.year ());
|
||||
Date thisDay (rightNow.month (), rightNow.day (), rightNow.year ());
|
||||
|
||||
if (dt < midnight)
|
||||
if (dt < thisDay)
|
||||
return 2;
|
||||
|
||||
Date nextweek = midnight + context.config.get ("due", 7) * 86400;
|
||||
if (dt < nextweek)
|
||||
int imminentperiod = context.config.get ("due", 7);
|
||||
|
||||
if (imminentperiod == 0)
|
||||
return 1;
|
||||
|
||||
Date imminentDay = thisDay + imminentperiod * 86400;
|
||||
if (dt < imminentDay)
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1686,6 +1686,9 @@ int handleReportCalendar (std::string &outs)
|
||||
report_filter += " due.after:" + after + " due.before:" + before;
|
||||
context.config.set ("report." + report + ".filter", report_filter);
|
||||
|
||||
// Display all due task in the report colorized not only the imminet ones
|
||||
context.config.set ("due", 0);
|
||||
|
||||
context.args.clear ();
|
||||
context.filter.clear ();
|
||||
context.sequence.clear ();
|
||||
|
||||
Reference in New Issue
Block a user