diff --git a/on-modify.relative-recur b/on-modify.relative-recur index 67335b4..df3a0c4 100755 --- a/on-modify.relative-recur +++ b/on-modify.relative-recur @@ -1,4 +1,5 @@ #!/usr/bin/env python +# https://github.com/JensErat/task-relative-recur from __future__ import print_function from builtins import str @@ -36,13 +37,19 @@ modified = json.loads(modified) # Has a task with UDA been marked as completed? if (UDA_DUE in original or UDA_WAIT in original) and original['status']!='completed' and modified['status']=='completed': del original['modified'] + + # have follow-up task be created without active time created by time tracking hook https://github.com/kostajh/taskwarrior-time-tracking-hook + if 'totalactivetime' in original: + del original['totalactivetime'] if 'start' in original: del original['start'] if UDA_DUE in original: original['due'] = calc(modified['end'] + '+' + original[UDA_DUE]) if UDA_WAIT in original: original['wait'] = calc(modified['end'] + '+' + original[UDA_WAIT]) + original['scheduled'] = calc(modified['end'] + '+' + original[UDA_WAIT]) original['status'] = 'waiting' + else: original['status'] = 'pending' print('Created follow-up task')