task.shift-recurrence icon indicating copy to clipboard operation
task.shift-recurrence copied to clipboard

shifting 'wait' attribute not needed

Open jdietrch opened this issue 9 years ago • 2 comments

I'm using taskwarrior 2.5.0.

I've been experimenting with this hook, and it works well to shift the 'scheduled' attribute of a recurring task. It also implies that the 'wait' attribute needs to be shifted. However, as far as I can see, taskwarrior itself is already shifting the 'wait' attribute of a recurring task, with the result that this hook doesn't end up changing the value of the 'wait' attribute.

I did two different things to try to find out what was going on. One, I changed this line: time_attributes = ('wait', 'scheduled') to this: time_attributes = ('scheduled',) And all still worked as well as before. Both the wait and scheduled attributes advanced as expected.

Second, I added some print statements to the hook to show the before and after values of the attributes being changed:

        for attr in time_attributes:
            print attr
            if parent[attr]:
                print "Before: ", task[attr]
                task[attr] = parent[attr] + parent_due_shift
                print "After: ", task[attr]

That produced this output:

$ task
[task next]
Warning: You have specified that the 'wait' date is after the 'scheduled' date.
wait
Before:  2016-02-25 16:48:00-05:00
After:  2016-02-25 16:48:00-05:00
scheduled
Before:  2016-02-25 16:45:30-05:00
After:  2016-02-25 16:48:30-05:00
Creating recurring task instance 'Mow the lawn'
No matches.

Notice that the 'wait' attribute is the same before and after, while the 'scheduled' attribute is being adjusted.

Am I missing something? Or is it not necessary to use this hook to adjust the 'wait' attribute of a recurring task?

Thank you, James

jdietrch avatar Feb 25 '16 22:02 jdietrch

that's weird - I didn't use the hook yet and wait wasn't shifted

xeruf avatar May 27 '20 19:05 xeruf

okay nevermind, I have proven it as well and put it into a reproducible command: https://github.com/tbabej/task.shift-recurrence/issues/6#issuecomment-634960606

xeruf avatar May 27 '20 21:05 xeruf