pimutils / khal

:calendar: CLI calendar application
https://lostpackets.de/khal/
MIT License
2.62k stars 207 forks source link

Support for date shortcuts #583

Open rohieb opened 7 years ago

rohieb commented 7 years ago

I use khal frequently on the command line, so I have aliased it to k in my shell. But navigating around the calendar or agenda with giving the full date is a bit cumbersome, I always have to type so much ;-) It would be of great help to have khal <date> as a shortcut to print the agenda for that date.

Then especially useful would be more date formats, e.g. khal 23rd would list the events at 23rd of the current month (maybe related to #169).

To be honest, my intended use of khal is heavily influenced by my usage of taskwarrior, which allows to filter tasks easily by giving a filter expression as the first parameter, and the "show events from this date" feels much like such a "filter". The taskwarrior manual has a long list of useful synonyms and date abbreviations, some of which could be useful for khal also.

geier commented 7 years ago

As khal is already a shortcut, by default to khal list, I believe adding any more shortcuts would make usage and implementation even more complicated. I would suggest instead alias k to khal list.

But adding some more shortcuts might be a good idea, but note, that we do support some of them the ones taskwarrior uses already, it's just not documented anywhere, currently supported:

rohieb commented 7 years ago

Aliasing k = khal list is indeed a solution. Then we have only the extended date syntax left. I would find especially useful:

geier commented 7 years ago

I'm going to rename the issue to 'Support for date shortcuts' so it's clearer what's the unresolved part is about.

lucc commented 7 years ago

I have some ideas for other aliases, shortcuts, syntax date extensions:

geier commented 7 years ago

date(time) [NX] + already works, where N is a number and X is one of d(ays), h(ours), m(inutes) or s(s econds) already works (with an optional space between mutlitple NX).

Example: khal new today 14:00 2h 30m meeting