validate: Pending tasks cannot have end attribute set

This commit is contained in:
Tomas Babej 2016-03-22 23:42:23 +01:00 committed by Paul Beckingham
parent 75403c0ec1
commit 8a50d8b6a9

View file

@ -1491,6 +1491,10 @@ void Task::validate (bool applyDefault /* = true */)
(! has ("end") || get ("end") == "")) (! has ("end") || get ("end") == ""))
setAsNow ("end"); setAsNow ("end");
// Pending tasks cannot have an end date, remove if present
if ((status == Task::pending) && (get ("end") != ""))
remove ("end");
// Provide an entry date unless user already specified one. // Provide an entry date unless user already specified one.
if (! has ("modified") || get ("modified") == "") if (! has ("modified") || get ("modified") == "")
setAsNow ("modified"); setAsNow ("modified");