khal icon indicating copy to clipboard operation
khal copied to clipboard

Day events and --notstarted

Open mredaelli opened this issue 5 years ago • 7 comments

Not sure if this is intended behaviour, but currently I have a day event for today:

❯ khal list
Today, 2021-01-13
 test ⟳

and I would expect that by doing:

❯ khal list --notstarted now 30m                                                                                                                                                                                    

would filter out the already-started event, but the output is the same.

mredaelli avatar Jan 13 '21 14:01 mredaelli

I just checked it happens also for non-recurring events

mredaelli avatar Jan 15 '21 08:01 mredaelli

I think is is a normal beavior, Khal documentation say:

With the –notstarted option only events are shown that start after START.

And when you don't specify a start date 'khal` assume that it is the present day at 0:00 and show your test event. I will test it more tomorrow,

ephase avatar Jan 17 '21 23:01 ephase

Hmm but if it started at 00:00, the it is already started, so why should it be included with -notstarted?

mredaelli avatar Jan 18 '21 10:01 mredaelli

@mredaelli I think there is a bug with allday event at this level, I'm going to test it this evening an push a Merge Request if needed.

ephase avatar Jan 18 '21 14:01 ephase

@mredaelli For me, there is no problem with normal events, khal as it should. But for all day event not. In my opinionkhal should not display the current day event when you do khal list even without now> Here is the code:

https://github.com/pimutils/khal/blob/2bbea841a4320bfa26c25a9918f5658d31e870cb/khal/controllers.py#L188-L191

I'll submit a draft MR to avoid the issue in minutes.

ephase avatar Jan 18 '21 22:01 ephase

In my opinionkhal should not display the current day event when you do khal list even without now> Here is the code:

I disagree with this part. It's in line with the documented behaviour. Changing this also prevents excluding multi-day events (that have started before the chosen day) but showing new events on that day.

d7415 avatar Jan 24 '21 13:01 d7415

since #1005 looks like it may end up being quite complex to implement - what is the best way to get the next event via Khal when you have an all-day event? Is there one?

E.g. if I have an event coming up in the next 15m, do I have to do khal list and parse out any all-day events from the results manually?

ceuk avatar Jan 04 '22 10:01 ceuk