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

All day events sometimes show on wrong day #84

Open
klundry opened this issue Feb 28, 2021 · 4 comments
Open

All day events sometimes show on wrong day #84

klundry opened this issue Feb 28, 2021 · 4 comments

Comments

@klundry
Copy link

klundry commented Feb 28, 2021

I have some all day events on a calendar and I'm running this command.

calendar-cli --calendar-url $URL calendar agenda --agenda-days 1

If I run this command on the day before an all day event the all day event gets listed.

@tobixen
Copy link
Owner

tobixen commented Feb 28, 2021

It may be a timezone issue. The caldav date search cannot be done with dates, it requires a timestamp in UTC if I remember correct, so it's very difficult to get this completely right unless living on Iceland and only having Icelandic events on the calendar.

I'm not going to spend more efforts on this now, but I would happily accept a pull/merge-request :-)

@klundry
Copy link
Author

klundry commented Feb 28, 2021

Fair enough. I think that is probably the issue. Explicitly specifiying the date for the current day seems to avoid the issue in this case. I think I have seen it display on the wrong date in the case of an event in the future as well. Will look into it some more when I see it happen again. Thanks.

@tobixen
Copy link
Owner

tobixen commented Feb 28, 2021

Ah ... then it's not a timezone issue. Actually, the code looks like this:

    elif args.agenda_days:
        dtend = dtstart + timedelta(args.agenda_days)

and dtstart is by default set to "now".

Hence, when choosing "7 days" (for a week) at a Monday afternoon, it will include all events for the full week plus all events prior to afternoon next Monday. That will also include all whole-day events for Monday.

I don't have the time/resources/mood to make any proper fix for this anytime soon, but I realize it can be considered a "bug".

@klundry
Copy link
Author

klundry commented Feb 28, 2021

Ok. I will see if I can figure out a workaround for now. I'm not a programmer so I wouldn't really now where to start to modify this.

Thanks for the project though. It's working great for my scripts otherwise.

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