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 todo without due #63

Closed
Unkn0wn-MDCLXIV opened this issue Apr 14, 2020 · 5 comments
Closed

Add todo without due #63

Unkn0wn-MDCLXIV opened this issue Apr 14, 2020 · 5 comments

Comments

@Unkn0wn-MDCLXIV
Copy link

Is there a way to add items to a todo list without setting a due date?
I'm adding items to a shopping list which obv dont need a due date.

@tobixen
Copy link
Owner

tobixen commented Apr 14, 2020

Of course items in a shopping list has a due date. You probably want to buy more milk this week, not the next? :-)

That's an interesting question. I do remember that when I made it, it made sense for me personally to have the default due set one day ahead (I would then go through all overdue tasks and push the due date forward), but I also remembered I was a bit concerned that this default probably didn't make much sense for everyone else.

I can see in the todo_add function at line 418 in master that if the set-due argument is not set, then the todo will be added with no due date. However, at line 844 the set-due argument gets a default value, and as far as I know it's not possible to unset it. One quick-fix would be to just remove the default value from that line, though I'm wary to break backward compatibility.

Another fix could be to add a check on 418 and treat blank values as non-existing. That's probably the best fix. Then it's just to add --set-due='' and it won't be set. I should probably also fix it so that the default value can be configured through the config file.

@tobixen
Copy link
Owner

tobixen commented Apr 14, 2020

I was reading the code slightly wrong, but anyway ... now it should be possible to do like this:

$ ./calendar-cli.py --config-section=work-tasks todo add --set-due='' 'test task'
Added todo item with uid=45a3ebe8-7e4b-11ea-8fed-9c8e99d15218

Now there is another potential problem that when trying to list the calendar item, it will show the default due date if the task has no due date.

$ ./calendar-cli.py --config-section=work-tasks todo --todo-uid=4723afda-7e4b-11ea-a713-9c8e99d15218 list
2020-04-14 (Tue)! 2020-04-28 (Tue) test task

@Unkn0wn-MDCLXIV
Copy link
Author

Thanks for the quick fix.
Todo list also shows the default date when a todo was added from a different client.
This happened before, too.

@tobixen
Copy link
Owner

tobixen commented Apr 14, 2020

Yes. It is sort of a bug, at the other hand difficult to do something with it as the backward compatibility will be broken. I should probably make a calendar-cli version 1.0 soon, breaking backward compatibility and python2-compatibility.

@tobixen
Copy link
Owner

tobixen commented May 1, 2020

I'll close this and track a "proper" fix in a new isse.

@tobixen tobixen closed this as completed May 1, 2020
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