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

add option to not delete past events #317

Merged
merged 6 commits into from
Mar 24, 2023

Conversation

non-bin
Copy link
Contributor

@non-bin non-bin commented Feb 21, 2023

addresses #117 by adding a toggle, to disable deleting past events

Helpers.gs Outdated Show resolved Hide resolved
@non-bin
Copy link
Contributor Author

non-bin commented Feb 25, 2023

ok it all works now, but I'm not 100% sure it covers all edge cases. The documentation mentions start.date but I think that's just for recurring events which are ignored by this method anyway, but then for start.dateTime it says:

A time zone offset is required unless a time zone is explicitly specified in timeZone.

but doesn't mention whether a zone will always be returned in the dateTime by the API, it seems to always put a timezone in both though.
It's annoying that we can't just use the standard API, which would just return a Date object and remove all these problems.

https://developers.google.com/calendar/api/v3/reference/events#start.date
https://developers.google.com/apps-script/reference/calendar/calendar-event#getStartTime()

@jonas0b1011001
Copy link
Collaborator

The documentation mentions start.date but I think that's just for recurring events

start.date is used for all-day events and should be considered aswell.

@non-bin
Copy link
Contributor Author

non-bin commented Feb 27, 2023

thanks, how's that?

@jonas0b1011001
Copy link
Collaborator

That will work!

@derekantrican
Copy link
Owner

Also #292

Helpers.gs Outdated Show resolved Hide resolved
@derekantrican derekantrican merged commit e5cd8e0 into derekantrican:master Mar 24, 2023
jonas0b1011001 pushed a commit that referenced this pull request May 22, 2024
* add option to not delete past events #117

* Remove unnessacary variable passed to processEventCleanup

* Fix date comparison

* add check of start.date

* Make ln 644 easier to understand
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.

3 participants