Search code examples
rfc5545google-calendar-api

Recurrent pattern to map on Google event pattern


Google implements recurring patterns partly with rfc 5545. I need to map on Google situation of repeat event Yearly, every fourth Wednesday in August (start time mapping is clear).

Implementation language to describe rule is not important, but if someone can recommend existing solution it would be good if java library is used.


More details from rfc 5545 specification:

Every Wednesday in August, forever:
RRULE:FREQ=YEARLY;BYMONTH=8;BYDAY=WE

It provides only partly solution. Is it can be improved?


Solution

  • Try this:

    {
      "summary": "Event every fourth Wednesday in August",
      "recurrence": [
        "RRULE:FREQ=YEARLY;BYMONTH=8;BYDAY=4WE;UNTIL=20191228"
      ],
      "start": {
        "dateTime": "2017-08-08T6:00:00",
        "timeZone": "timeZone"
      },
      "end": {
        "dateTime": "2017-08-08T7:00:00",
        "timeZone": "timeZone"
      }
    }
    

    This will make your even occur every year, 4th Wednesday of August.

    Reference:

    Hope this helps