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 727602f26f
commit cc324fdb8d

View file

@ -1491,6 +1491,10 @@ void Task::validate (bool applyDefault /* = true */)
(! has ("end") || get ("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.
if (! has ("modified") || get ("modified") == "")
setAsNow ("modified");