Subject: Max # of occurences in a recur rule?

From: Eric Busboom <[email-masked]>
Date: Thu, 1 Jun 2000 14:38:15 -0700 (PDT)

RFC2445 says that BYSETPOS can select from only 366 occurences in an
interval. This seems sensible, since any recurrence rule that had more
than 366 occurences per interval could be re-written to have less. Can an
implementation assume that there will be no more 366 occurences per
interval and reject any rule that has more?

Implementing recurrence rules gets difficult when you have to handle the
most general case, since some of these cases get excessive. For instance: 

	RRULE:FREQ=YEARLY; BYYEARDAY=1,2,3,4,...,364,365,366;
	 BYHOUR=0,...,23;BYMINUTE=0,...59;BYSECOND=0,...,59;
	 BYSETPOS=1,100,-100,-1

This rule selects 4 out of 31 million occurences, and the use of SETPOS is
an abuse of the original intent.  Handling it without resource exhaustion
or excessive run times requires an extraordinary programmer or an ugly
special case.

Can an implementation reject a strictly conforming but logically
insensible rrule? Or can we make un-normalized RRULEs non-conforming? I
think we need to reduce some of the unlimited possibilites of the
recurrence grammar to be able to write conforming, efficient and
bug-free code.

eric.