INTERVAL, DTSTART and BYxxx modifiers
"Laird Nelson" <[email protected]> Tue, 7 Jun 2005 11:28:07 -0400
| Newsgroups | gmane.ietf.calendar |
|---|---|
| Message-ID | <[email protected]> |
I hope this is a meaningful question; please point me in the right direction if not. Consider the following arbitrary RRULE, significant mainly for its INTERVAL rule part: DTSTART;TZID=US-Eastern:19970105T083000 RRULE:FREQ=DAILY;INTERVAL=5;BYMONTH=1 Now suppose that I want my recurrence engine to return me the next instance relative to today's date (June 7, 2005). If the INTERVAL were 1 (or, equivalently, not specified), then it would be clear that the next instance would be January 1, 2006 08:30:00 EST. Would the same be true when the INTERVAL is 5 (as it is in my example)? Or must I first compute the total set of *unmodified* occurrences (e.g. every fifth day, period, end of story) and then eliminate all such instances that are not "contained" by the BYMONTH modifier? Another way to tput this is, sitting here, I'm not sure offhand what day in January 2006 you'll "land on" if you iterate over every fifth day, starting from January 1, 1997, so I'm not sure offhand which day in January 2006 matches the rule. Must I perform this calculation before applying my BYxxx rule parts? RFC 2445 says: If multiple BYxxx rule parts are specified, then after evaluating the specified FREQ and INTERVAL rule parts, the BYxxx rule parts are applied to the current set of evaluated occurrences in the following order: BYMONTH, BYWEEKNO, BYYEARDAY, BYMONTHDAY, BYDAY, BYHOUR, BYMINUTE, BYSECOND and BYSETPOS; then COUNT and UNTIL are evaluated. This leads me to believe that I must actually compute the entire set of occurrences (when INTERVAL > 1) even if all I want to do is just find the occurrence immediately after some reference date. Is that the intention? Thanks, Laird