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

Add dates to the written files #56

Merged
merged 1 commit into from
Oct 4, 2018
Merged

Conversation

daniellandau
Copy link

The completion date is mandatory as per the format and the creation date is also
useful. These are not shown to the user yet in this todo.txt client, but are
used in many others, so it's useful to include them already in the file even
though we don't yet have an implementation for showing them in the UI.

Your implementation of the parsing is much cleaner. Showing the dates (and sorting by them) would be good, but for the time being I'd be somewhat happy even with just saving them as I also use the todo file on my phone and there I already sort by creation date. I can't really use Go-For-It at all if it doesn't include creation dates in the file as then it messes up the file for the other client.

The completion date is mandatory as per the format and the creation date is also
useful. These are not shown to the user yet in this todo.txt client, but are
used in many others, so it's useful to include them already in the file even
though we don't yet have an implementation for showing them in the UI.
@JMoerman
Copy link
Owner

JMoerman commented Sep 15, 2018

The completion date is mandatory as per the format and the creation date is also
useful.

According to https://github.com/todotxt/todo.txt neither completion date nor creation date is mandatory. However, if a completion date is present a creation date must also be present. This means that with the changes from 9c877b0 Go For It! will generate invalid todo.txt lines for tasks which did not contain a creation date.

@daniellandau
Copy link
Author

daniellandau commented Sep 15, 2018

This is the section I'm reading to get my conclusions:

If you’ve prepended the creation date to your task, on completion it will appear directly after the completion date.
[...]
With the completed date (required), if you've used the prepended date (optional)

@JMoerman
Copy link
Owner

Allright, that means that a completion date is mandatory if and only if a creation date is present in a completed task.

@daniellandau
Copy link
Author

What, no it doesn't. Without the comma it might, but as it stands no way. The if sentence there is related to

if you've used the prepended date (optional), you can calculate how many days it took to complete a task.

@JMoerman
Copy link
Owner

JMoerman commented Sep 15, 2018

That last sentence is a bit weird, but from (a):

If you’ve prepended the creation date to your task, on completion it will appear directly after the completion date.

and (b):

Rule 2: A task's creation date may optionally appear directly after priority and a space.

and, finally (c): https://github.com/todotxt/todo.txt/blob/master/description.png

we get the following rules:

  1. A creation date is optional (b, c)
  2. If a creation date is present a completion date must be present for completed tasks (a)
  3. If a completion date is present a creation date must be present (c)
  4. A completion date is optional (c). (Also follows from 1. and 3. combined)

@JMoerman JMoerman merged commit 9c877b0 into JMoerman:master Oct 4, 2018
@JMoerman
Copy link
Owner

JMoerman commented Oct 4, 2018

I was waiting on an official response on todotxt/todo.txt#21, but that doesn't seem to be happening any time soon.
I merged it, but also added a check for the existence of the creation date ensuring that either both exist or neither exist for finished tasks.

@daniellandau
Copy link
Author

Sounds good, thanks!

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

Successfully merging this pull request may close these issues.

2 participants