1

I’m developing a project in which I have to schedule some repetitive events for final users in Google Calendar. I’ve been working with the Calendar’s Python API, and so far I have had no problems by using the most common recurrent rules according to the RFC 5545 standard.

However, it would be helpful to schedule recurring events without a pattern. I mean, instead of telling Google to schedule weekly for 3 occasions on Friday, I’d like to specify the dates for such set of events and have all of them registered under the same event ID.

Does anyone know if this is possible? Any comment would be much appreciated!

Rafa DM
  • 11
  • 3

2 Answers2

0

This is possible, yet not very easily. The standard that you mention has this actually described here: Link to standard page 120.

  The recurrence dates, if specified, are used in computing the
  recurrence set.  The recurrence set is the complete set of
  recurrence instances for a calendar component.  The recurrence set
  is generated by considering the initial "DTSTART" property along
  with the "RRULE", "RDATE", and "EXDATE" properties contained
  within the recurring component.  The "DTSTART" property defines
  the first instance in the recurrence set.  The "DTSTART" property
  value SHOULD match the pattern of the recurrence rule, if
  specified.  The recurrence set generated with a "DTSTART" property
  value that doesn't match the pattern of the rule is undefined.
  The final recurrence set is generated by gathering all of the
  start DATE-TIME values generated by any of the specified "RRULE"
  and "RDATE" properties, and then excluding any start DATE-TIME
  values specified by "EXDATE" properties.  This implies that start
  DATE-TIME values specified by "EXDATE" properties take precedence
  over those specified by inclusion properties (i.e., "RDATE" and
  "RRULE").  Where duplicate instances are generated by the "RRULE"
  and "RDATE" properties, only one recurrence is considered.
  Duplicate instances are ignored.

This means that you can have a startdate (DTSTART) and a recurrence rule (RRULE). By using the EXDATE, you could make a RRULE that says `every day from STARTDATE to ENDDATE except for [list of all hours you do not want]'. This only works per day, you cannot have an meeting per hour per the standard.

Community
  • 1
  • 1
JarroVGIT
  • 4,291
  • 1
  • 17
  • 29
0

I solved my problem using RDATE:

event = {'summary': 'Voluntariado Grandes Amigos',
    'description': 'TEST', 
    'start': {'dateTime': '2021-02-07T17:30:00',
            'timeZone': 'America/Mexico_City'},
    'end': {'dateTime': '2021-02-07T18:00:00',
            'timeZone': 'America/Mexico_City'}, 
    'recurrence': ["RDATE;VALUE=DATE-TIME:20210207T190000,20210207T214500"],
    'attendees': [{'email': 'someEmail1@gmail.com',
                   'email': 'someEmail2@gmail.com'}],
    'reminders': {'useDefault': False, 'overrides': [{'method': 'email', 'minutes': 60}]},
     
}

It's working good enough, though any other suggestions or comments are welcomed as well :)

Rafa DM
  • 11
  • 3