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

Day events and --notstarted #1004

Open
mredaelli opened this issue Jan 13, 2021 · 7 comments · May be fixed by #1005
Open

Day events and --notstarted #1004

mredaelli opened this issue Jan 13, 2021 · 7 comments · May be fixed by #1005

Comments

@mredaelli
Copy link

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
Copy link
Author

I just checked it happens also for non-recurring events

@ephase
Copy link
Contributor

ephase commented Jan 17, 2021

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,

@mredaelli
Copy link
Author

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

@ephase
Copy link
Contributor

ephase commented Jan 18, 2021

@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
Copy link
Contributor

ephase commented Jan 18, 2021

@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:

khal/khal/controllers.py

Lines 188 to 191 in 2bbea84

# to understand what's going on here this way
if notstarted:
if event.allday and event.start < original_start.date():
continue

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

@d7415
Copy link
Collaborator

d7415 commented Jan 24, 2021

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.

@ceuk
Copy link

ceuk commented Jan 4, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants