From d68395bc511642fb8f883a6e25ac82403c226693 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 17 Jun 2008 17:52:12 -0400 Subject: [PATCH] - Fixed bug whereby if you have more than one task with a due date, 7 days gets added to the entry date of task 2..n --- src/task.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/task.cpp b/src/task.cpp index 42251f947..9ba532724 100644 --- a/src/task.cpp +++ b/src/task.cpp @@ -509,8 +509,8 @@ void handleList (const TDB& tdb, T& task, Config& conf) due = dt.toString (conf.get ("dateformat", "m/d/Y")); overdue = (dt < now) ? true : false; - now += 7 * 86400; - imminent = dt < now ? true : false; + Date nextweek = now + 7 * 86400; + imminent = dt < nextweek ? true : false; } std::string active; @@ -679,8 +679,8 @@ void handleSmallList (const TDB& tdb, T& task, Config& conf) due = dt.toString (conf.get ("dateformat", "m/d/Y")); overdue = (dt < now) ? true : false; - now += 7 * 86400; - imminent = dt < now ? true : false; + Date nextweek = now + 7 * 86400; + imminent = dt < nextweek ? true : false; } std::string active; @@ -955,8 +955,8 @@ void handleInfo (const TDB& tdb, T& task, Config& conf) if (due.length ()) { overdue = (dt < now) ? true : false; - now += 7 * 86400; - imminent = dt < now ? true : false; + Date nextweek = now + 7 * 86400; + imminent = dt < nextweek ? true : false; if (conf.get ("color", true)) { @@ -1175,8 +1175,8 @@ void handleLongList (const TDB& tdb, T& task, Config& conf) due = dt.toString (conf.get ("dateformat", "m/d/Y")); overdue = (dt < now) ? true : false; - now += 7 * 86400; - imminent = dt < now ? true : false; + Date nextweek = now + 7 * 86400; + imminent = dt < nextweek ? true : false; } std::string age; @@ -1531,8 +1531,8 @@ void handleReportNext (const TDB& tdb, T& task, Config& conf) due = dt.toString (conf.get ("dateformat", "m/d/Y")); overdue = (dt < now) ? true : false; - now += 7 * 86400; - imminent = dt < now ? true : false; + Date nextweek = now + 7 * 86400; + imminent = dt < nextweek ? true : false; } std::string active; @@ -2044,8 +2044,8 @@ void handleReportActive (const TDB& tdb, T& task, Config& conf) Date now; overdue = dt < now ? true : false; - now += 7 * 86400; - imminent = dt < now ? true : false; + Date nextweek = now + 7 * 86400; + imminent = dt < nextweek ? true : false; } // All criteria match, so add refTask to the output table.