From 2690d9bdf36567f17f434172e23a92206b8596e1 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Tue, 15 Sep 2015 07:15:16 -0400 Subject: [PATCH] Task: Correct a false-positive warning - The command "task 1 modify due: wait:2days" gave the following output: Warning: You have specified that the 'wait' date is after the 'due' date. Now, we check if the due date is zero, in which case the due date is being removed. --- ChangeLog | 2 ++ src/Task.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 10a933754..12600cb1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -197,6 +197,8 @@ of 'urgency.user.tag.next.coefficient'. - The long deprecated syntax of color values with underscores (i.e 'on_red') is no longer supported. +- Correct a false-positive warning when a due date is removed and a wait is + added. ------ current release --------------------------- diff --git a/src/Task.cpp b/src/Task.cpp index bbeb0ef35..85b65a133 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -1572,7 +1572,8 @@ void Task::validate_before (const std::string& left, const std::string& right) Date date_left (get_date (left)); Date date_right (get_date (right)); - if (date_left > date_right) + // if date is zero, then it is being removed (e.g. "due: wait:1day") + if (date_left > date_right && date_right != 0) context.footnote (format (STRING_TASK_VALID_BEFORE, left, right)); } #endif