tobixen / calendar-cli

Simple command-line CalDav client, for adding and browsing calendar items, todo list items
GNU General Public License v3.0
247 stars 23 forks source link

Due dates and duration #64

Open tobixen opened 4 years ago

tobixen commented 4 years ago

This is a follow-up of #63, to be fixed "properly" in some upcoming 1.0-release, possibly with some work-arounds in 0.12 or 0.13.

As of 0.11, todo items with no due date set will be shown with a due date (calcualated out from a hard coded default duration). If no due date is given when creating a vtodo item, the due date is set through a hard-coded default duration. Further, handling of the DURATION field in the vtodo when listing tasks is probably broken.

While the hard coded default did make sense in my specific use case back then, it does not make sense to have this hard-coded, and probably the most logical action would be not to show any due-date if neither due-date nor duration is given in the task, and also not to set any due date if nothing is given when creating the task. For users who wants to keep default duration when listing and/or creating tasks, it should be possible to specify this in the config file.

0.12 and (if there will be any) 0.13 should be backward-compatible with 0.11, hence the user has to be explicit either in the command line options or in the configuration to avoid default due dates in future 0.x-releases.

tobixen commented 4 years ago

I've considered not to do any work here prior to version 0.12.

I was considering to make it possible to specify in the configuration that tasks by default should be created without due and/or without dtstart. However, apparently it's only possible to edit the defaults for the global options in the config file. Changing this would be a bigger task. Stop-gap solutions for those wanting to generate lots of todos without timestamps can be to create a command-line alias, or to edit calendar-cli and set the default to '' for --set-due and --set-dtstart.

The agenda also assumes some default due date if none is given. I was considering to change this, but I realize that it's non-trivial to support this in a neat way, it should be properly supported both in the sorting and printing of tasks. I think tasks without a due date set should be considered equal with tasks with the due date set in the indefinite future, perhaps --default-due should be set to a very high number. (Bad naming of the parameter btw).

Support of tasks with duration set instead of due is relatively trivial to fix, but requires some research first (and test code). I simply don't have the capacity right now, but I do want to release 0.12 now, so it will have to be postponed.