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 possibly wrong #42

Closed
chipschap opened this issue Oct 30, 2019 · 4 comments
Closed

All day events possibly wrong #42

chipschap opened this issue Oct 30, 2019 · 4 comments

Comments

@chipschap
Copy link

When importing from Google Calendar, all day events for me are showing up a day early, for instance a Nov 18 all-day event comes out in org-mode as Nov 17. I made this change to fix it:

               else:  # all day event
                    fh_w.write(u"  {}--{}\n".format(

orgDate(comp_start, self.tz),

orgDate(comp_end - timedelta(days=1), self.tz)))

                        orgDate(comp_start + timedelta(days=1), self.tz),
                        orgDate(comp_end, self.tz)))

The reason is that Google calendar lists an all-day event with the previous day as the start time and the actual day as the end time. I don't know if other calendars do the same, so my patch might not be valid universally. However it's a possible fix for users of Google calendar (only). This should also work for multi-day events.

@asoroa
Copy link
Collaborator

asoroa commented Nov 2, 2019

Hi,
I can't reproduce this. Here is an example of an all-day event for next tuesday nov 5. The event is created in google calendar, and as you can see the DTSTART/DTEND fields are correct (the event starts on nov 5 and ends on nov 6):

BEGIN:VEVENT
DTSTART;VALUE=DATE:20191105
DTEND;VALUE=DATE:20191106
DTSTAMP:20191102T181729Z
UID:4ou73anjghlkhp9v443pmua2nr@google.com
CREATED:20191102T181546Z
DESCRIPTION:
LAST-MODIFIED:20191102T181546Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:All day event on tuesday Nov 5.
TRANSP:TRANSPARENT
END:VEVENT

@chipschap
Copy link
Author

chipschap commented Nov 2, 2019 via email

@chipschap
Copy link
Author

chipschap commented Nov 3, 2019 via email

@asoroa asoroa closed this as completed in d7b58b0 Nov 5, 2019
@asoroa
Copy link
Collaborator

asoroa commented Nov 5, 2019

Hi again,
(sorry for taking so long).
Your explanation makes a lot of sense. I've merged your change in the repo.
Thanks for digging into it and coming out with the solution!

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