recur: Remove WIP recurrence overhaul implementation

The feature has been moved to 3.0 milestone. Also, we are now using
feature branches for development of new functionality, in order to make
the development branch more stable.
This commit is contained in:
Tomas Babej 2021-06-12 10:37:23 -04:00
parent 7011cfb05a
commit 4db7990df8
No known key found for this signature in database
GPG key ID: B0747C6578F7D2F5
3 changed files with 25 additions and 374 deletions

View file

@ -412,3 +412,27 @@ void updateRecurrenceMask (Task& task)
}
////////////////////////////////////////////////////////////////////////////////
// Delete expired tasks.
void handleUntil ()
{
Datetime now;
auto tasks = Context::getContext ().tdb2.pending.get_tasks ();
for (auto& t : tasks)
{
// TODO What about expiring template tasks?
if (t.getStatus () == Task::pending &&
t.has ("until"))
{
auto until = Datetime (t.get_date ("until"));
if (until < now)
{
Context::getContext ().debug (format ("handleUntil: recurrence expired until {1} < now {2}", until.toISOLocalExtended (), now.toISOLocalExtended ()));
t.setStatus (Task::deleted);
Context::getContext ().tdb2.modify(t);
Context::getContext ().footnote (onExpiration (t));
}
}
}
}
////////////////////////////////////////////////////////////////////////////////