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

CreateEventFromVOBJ: if there is no dtend, use the duration if available #771

Merged
merged 3 commits into from
Sep 26, 2024

Conversation

dbarnett
Copy link
Collaborator

@dbarnett dbarnett commented Sep 23, 2024

Fixes #486.

Credit: Changes taken from #282 and rebased onto main, with trivial cleanups and a tweak to the dtstart-only case (30m duration + info message instead of 0m duration).

@@ -64,65 +64,54 @@ def CreateEventFromVOBJ(

event['recurrence'] = ['RRULE:' + ve.rrule.value]

if hasattr(ve, 'dtstart') and ve.dtstart.value:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined this check w/ the one above and dedented this huge if block.

Technically if an event had .dtstart but not .dtstart.value this change might skip that event more explicitly, but I'm pretty sure that scenario was never valid and nobody was relying on that corner case behavior.

gcalcli/ics.py Outdated
Comment on lines 116 to 117
# Decide based on dtstart; that's what we base our calculation on.
# TODO: correct?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a look at this TODO and it looked pretty obvious that yes duration is always counting from dtstart. Removed the TODO comment.

@dbarnett
Copy link
Collaborator Author

Alright @tschwinge @jcrowgey I'm happy with my updated version of these changes. LMK if either of you wants to take a look before I merge them.

@dbarnett dbarnett merged commit bcda636 into main Sep 26, 2024
10 checks passed
@dbarnett dbarnett deleted the dtend-duration branch September 26, 2024 21:08
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

Successfully merging this pull request may close these issues.

Import fails, seemingly because of no end time
2 participants