It seems that there's an issue with WEEKLY recurrences with INTERVALs over 1, where the seed date is (effectively) used as the WKST day instead of the actual WKST day being used. For example, with WKST=SU, if you have a semiweekly tuesday/thursday event, and the first occurrence is a thursday, the second occurrence should be 12 days later, not 5. There is an example in the iCalendar specification that makes this clear (see http://www.kanzaki.com/docs/ical/rrule.html\):
Every other week on Monday, Wednesday and Friday until December 24,
1997, but starting on Tuesday, September 2, 1997:
==> (1997 9:00 AM EDT)September 2,3,5,15,17,19,29;October
(1997 9:00 AM EST)October 27,29,31;November 10,12,14,24,26,28;
Here is some sample code (in Groovy):
seed = new DateTime("19970902T090000")
until = new DateTime("19971224T000000Z")
r = new Recur("FREQ=WEEKLY;INTERVAL=2;UNTIL=19971224T000000Z;WKST=SU;BYDAY=MO,WE,FR")
r.getDates(seed, seed, until, Value.DATE_TIME)
The last line returns the following, which differs from the results given in the iCalendar spec:
You can see that the third element of this result is September 8th, 1997; whereas, the 3rd result (excluding the initial occurrence, which is not part of the rrule) of the iCalendar spec's example is September 15th, 1997.
Log in to post a comment.