diff --git a/NEWS b/NEWS index 8deead819..d9c6f8212 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ New Features in task 1.9 - New columns that include the time as well as date - New attribute modifiers - Improved .taskrc validation + - Improved calendar report with custom coloring and optional task details output Please refer to the ChangeLog file for full details. There are too many to list here. diff --git a/src/Config.cpp b/src/Config.cpp index 2ce5a5d02..d40f269c7 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -172,6 +172,7 @@ void Config::createDefaultRC (const std::string& rc, const std::string& data) << "#color.recurring=on_red # Color of recur.any: tasks\n" << "#color.header=bold_green # Color of header messages\n" << "#color.footnote=bold_green # Color of footnote messages\n" + << "#color.alternate=on_rgb253 # Alternate color for line coloring\n" << "color.calendar.today=black on cyan # Color of today in calendar\n" << "color.calendar.due=black on green # Color of days with due tasks in calendar\n" << "color.calendar.overdue=black on red # Color of days with overdue tasks in calendar\n" diff --git a/src/report.cpp b/src/report.cpp index 12d938044..9a0b860ae 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -416,15 +416,16 @@ int handleInfo (std::string &outs) table.addCell (row, 1, due); overdue = (dt < now) ? true : false; - Date nextweek = now + 7 * 86400; - imminent = dt < nextweek ? true : false; + int imminentperiod = context.config.get ("due", 7); + Date imminentDay = now + imminentperiod * 86400; + imminent = dt < imminentDay ? true : false; if (context.config.get ("color", true) || context.config.get (std::string ("_forcecolor"), false)) { if (overdue) table.setCellColor (row, 1, Color (context.config.get ("color.overdue", "red"))); else if (imminent) - table.setCellColor (row, 1, Color (context.config.get ("color.due", "yellow"))); + table.setCellColor (row, 1, Color (context.config.get ("color.due", "green"))); } }