creating recurring calendar event between dates gets one extra on "start" date

231 views
Skip to first unread message

Martin Yonke

unread,
Aug 15, 2022, 5:57:23 PM8/15/22
to Google Apps Script Community
I must be doing something wrong, but I can't figure out what. (I've described this issue including code and an event object in https://stackoverflow.com/questions/73340674). I want to create an recurring event that lasts for one calendar year. To do this I created an event object using "start" and "end" to specify the start and end times and using the date 1/1/2023. I use "recurrence" using an rrule that says "until" 12/31/2023. What gets created is a recurring event with all the events specified by the rrule (great), but I also get one extra on 1/1/2023--the date in the "start" and "end". I think that is where I'm going wrong. But how do I tell it to create a recurring event between 1/1/2023 and 12/31/2023 following the rrule without getting one extra on 1/1?
Thanks for your help.

CBMServices Web

unread,
Aug 15, 2022, 8:22:14 PM8/15/22
to google-apps-sc...@googlegroups.com
The start date is the date of the first event. That is what it is expecting unfortunately so you will need to work around that.


On Mon., Aug. 15, 2022, 2:57 p.m. Martin Yonke, <martin...@gmail.com> wrote:
I must be doing something wrong, but I can't figure out what. (I've described this issue including code and an event object in https://stackoverflow.com/questions/73340674). I want to create an recurring event that lasts for one calendar year. To do this I created an event object using "start" and "end" to specify the start and end times and using the date 1/1/2023. I use "recurrence" using an rrule that says "until" 12/31/2023. What gets created is a recurring event with all the events specified by the rrule (great), but I also get one extra on 1/1/2023--the date in the "start" and "end". I think that is where I'm going wrong. But how do I tell it to create a recurring event between 1/1/2023 and 12/31/2023 following the rrule without getting one extra on 1/1?
Thanks for your help.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/efa41b8b-242c-4132-a81c-cf770ed95be7n%40googlegroups.com.

Martin Yonke

unread,
Aug 16, 2022, 11:01:31 AM8/16/22
to Google Apps Script Community
Thanks. I see that, but what is the workaround? When I use the calendar GUI and specify starting on 1/1 until 12/31 Google does not create a 1/1 event. What are they doing? That's the behavior I want to replicate. Thanks in advance for any suggestions.

CBMServices Web

unread,
Aug 16, 2022, 12:58:45 PM8/16/22
to google-apps-sc...@googlegroups.com
Unfortunately the Google UI does not use the same software as what they made available to us via the API. For example a delete of an event from the UI generates an event cancelled email to all guests. If you delete the event via the API, there is no cancel email generated.

One workaround would be for your software to figure out the first date that meets your rule and then use that date as the start date of the event series. This is somewhat replicating what they are doing in the API software as well but not sure if you have any other ideas.

Another workaround would be to create the event series, then delete first event in series if it does not meet rule.

Sorry, wish I had better news for you.


Reply all
Reply to author
Forward
0 new messages