Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recurrence rule definition (RFC2445) question

I'm using Google's RFC2445 implementation (http://code.google.com/p/google-rfc-2445/) for recurrence rules. If I define a MONTHLY recurrence starting on the 30th of January, months with less than 30 days (i.e., February) will be totally skipped. So the Google API would return 30th Jan, 30th March, 30th April, etc. Not good. I would expect it to return: 30th Jan, 28th Feb, 30th March, 30th April.

Similarly, if I picked a start date of the 31st of January, then any months with less than 31 days would be skipped.

This may be correct as per the RFC2445 spec or may be a bug. What do you think?

My main question is, is there any way to define a rule which says "recur on the 30th of every month; or the last day of the month if the 30th doesn't exist". I do not believe there is. Any suggestions?

Thanks in advance.

Regards, Cormac

like image 326
Cormac Redmond Avatar asked Jan 30 '09 17:01

Cormac Redmond


1 Answers

The answer is: FREQ=MONTHLY;BYMONTHDAY=28,29,30;BYSETPOS=-1 which translates to "recur on the 30th of every month; or the last day of the month if the 30th doesn't exist".

like image 108
Cormac Redmond Avatar answered Nov 19 '22 03:11

Cormac Redmond