I'm trying to add event in the calendar programatically. I want the event to repeat yearly, every first Monday in February for example. The rule I'm using is this:
FREQ=YEARLY;BYDAY=1MO;BYMONTH=2;INTERVAL=1;COUNT=11;
The problem is: if I create the event with starting date in January and set it to repeat every January, then it works fine. But, If i create the event with starting date in other month other than February, and set it to repeat by the same rule, the event won't repeat on Monday but on some other day. That day is different depending in which month is the starting day of the event. It seems like it counts number of day because on the leap year the day is changed by one.
UPDATE:
I noticed that if I create an event as mentioned above the following happens: If I create the event for example in February and set to be repeated in March, the rule gets the number of days in month from the moth where the DTSTART
of the event is set (February). So, if I create an event in February and set it to be repeated the last day in March it will be repeated every 28th March or 29th on leap years (instead of 31st as expected).
Another example: I create event with DTSTART
in January 2013 and set it to be repeated every first Monday in February. It creates the event on the date in February 2013 that corresponds to the first Monday in January 2013, in this case that is 7th February (because 7th January is first Monday in January 2013). Every next year the event will be repeated on the first Thursday of February.