Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shifting 'wait' attribute not needed #5

Open
jdietrch opened this issue Feb 25, 2016 · 2 comments
Open

shifting 'wait' attribute not needed #5

jdietrch opened this issue Feb 25, 2016 · 2 comments

Comments

@jdietrch
Copy link

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

@xeruf
Copy link

xeruf commented May 27, 2020

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

@xeruf
Copy link

xeruf commented May 27, 2020

okay nevermind, I have proven it as well and put it into a reproducible command: #6 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants