Subject: Re: Can we fix BYSETPOS?

From: [email-masked]
Date: Fri, 8 Jun 2001 13:39:13 -0400

Jonathan replied in part:
>                                       Using contracting rules in
>conjunction with BYSETPOS, given the above definition, is nonsensical:
>        RECUR:FREQ=WEEKLY;BYMONTH=4;BYSETPOS=1
>since a RECUR with only contracting rules will always have only
>single-element sets.

W/o the BYSETPOS=1, this rule says that the entry repeats every week in 
April.  If I had a DTSTART;TZID=US-Eastern:20010406T090000 w/this rule then the repeat set would be:

(09:00:00 EDT) 06-Apr-2001, 13-Apr-2001, 20-Apr-2001, 27-Apr-2001
(09:00:00 EDT) 05-Apr-2002, 12-Apr-2002, 19-Apr-2002, 26-Apr-2002
...

However w/the BYSETPOS=1 the resulting repeat set becomes:

(09:00:00 EDT) 06-Apr-2001
(09:00:00 EDT) 05-Apr-2002
...

Essentially its the "1st Friday in April, forever" given my DTSTART, a 
very logical set.  However if you wanted to just have that set then a rule 
like:

RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=FR;BYMONTHDAY=1,2,3,4,5,6,7

or even simpler:

RRULE:FREQ=MONTHLY;BYDAY=1FR;BYMONTH=4

w/o any BYSETPOS subcomponents.

Bruce
===========================================================================
Bruce Kahn                                INet: [email-masked]
Iris Associates                          Phone: 978.392.5335
Westford, MA, USA 01886                    FAX: and nothing but the FAX...
Standard disclaimers apply, even where prohibited by law...

---

From: Jonathan Lennox <[email-masked]>
Date: Fri, 8 Jun 2001 14:00:03 -0400 (EDT)

> (09:00:00 EDT) 05-Apr-2002

Why?

Why is the "set," for this rule, "all the events within a year" (or is it
"within a month"), rather than, say, "within a week" (FREQ) or "within
twenty-eight years" (least-common-multiple of BYMONTH and WEEKLY)?

Can you write a pseudo-code algorithm which, for any combination of FREQ,
INTERVAL, and any BY* rules except BYSETPOS, tells me which event
recurrences should be marked as beginning a "set"?

-- 
Jonathan Lennox
[email-masked]