Search code examples
google-calendar-apirecurring-eventsrrule

Is there a way to create a rrule for recurrent events that only fall into weekdays?


I am trying to user google calendar api to schedule events, they have different recurrency types

type1: weekly
type2: every 14 days
type3: every 28 days
type4: every 42 days
type5: every 56 days

The problem is: if the 56th day falls on the weekend, the appointment should be moved to monday.

I am new to rrule, and am trying to get my head around this. Can someone help me to understand a little bit?


Solution

  • Nevermind, Just noticed that for this specific answer, all the types are variations for the weekly

    type1: weekly - weekly :)
    type2: every 14 days - weekly, every other week
    type3: every 28 days - weekly, every 4 weeks
    type4: every 42 days - weekly, every 6 weeks
    type5: every 56 days - weekly, every 8 days
    

    For the sake of future implementations, and for me to try to understand RRules better, though, let's make this a bit harder, WHAT IF this is something like:

    type1: weekly
    type2: every 13 days
    type3: every 27 days
    type4: every 41 days
    type5: every 55 days 
    

    Can someone please try and explain me how to go through this issue?

    Thanks!!