taskpaper-repeat icon indicating copy to clipboard operation
taskpaper-repeat copied to clipboard

repeat-from-done actually repeats from script run time rather than done time

Open trajanmcgill opened this issue 4 years ago • 1 comments

Scenario:

  1. - some task @start(2021-07-19) @due(2021-07-19) @repeat(Monday,Tuesday,Wednesday,Thursday,Friday) @repeat-from-done

  2. Task above gets marked done on 7-19 (tag added: @done(2021-07-19)), but for whatever reason the repeat script isn't run immediately (e.g., maybe the user never launched it, or the task list was marked done outside of TaskPaper).

  3. User opens TaskPaper the next day (7-20) and launches taskpaper-repeat to generate recurrences.

  4. Expected: - some task @start(2021-07-20) ... is created. Actual: - some task @start(2021-07-21) ... is created.

Looking at the source code of the script, it appears this is happening around lines 27-29, where the new date is not actually being generated from the "done" date, but from the "now" date. In many cases those will be the same, but if the script is not run at the same time the @done tag is added, they could be entirely different dates.

trajanmcgill avatar Jul 20 '21 15:07 trajanmcgill

This is a very useful script that neatly solves a common problem, by the way. Out of curiosity, how come the script itself is not in this repository, only added to it as a release resource?

trajanmcgill avatar Jul 20 '21 15:07 trajanmcgill