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.
This commit is contained in:
Scott Kostyshak 2015-09-15 07:15:16 -04:00 committed by Paul Beckingham
parent 11009fd3ff
commit 2690d9bdf3
2 changed files with 4 additions and 1 deletions

View file

@ -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 ---------------------------

View file

@ -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