Subject: [ietf-calsify] Question about interaction between DTSTART and BYSETPOS

From: Rick DeNatale <[email-masked]>
Date: Thu, 22 Jan 2009 14:44:55 -0500

_______________________________________________
ietf-calsify mailing list
[email-masked]
http://lists.osafoundation.org/mailman/listinfo/ietf-calsify

---

From: Reinhold Kainhofer <[email-masked]>
Date: Fri, 23 Jan 2009 22:15:14 +0100

Am Donnerstag, 22. Januar 2009 20:44:55 schrieb Rick DeNatale:
> The 3rd instance into the month of one of Tuesday, Wednesday or Thursday,
> for the next 3 months:
>
>   DTSTART;TZID=US-Eastern:19970904T090000
>
>   RRULE:FREQ=MONTHLY;COUNT=3;BYDAY=TU,WE,TH;BYSETPOS=3
>   ==> (1997 9:00 AM EDT)September 4;October 7
>          (1997 9:00 AM EST)November 6
>
> As I understand things, the recurrence set consists of the occurrence
> specified by DTSTART (regardless whether or not that time meets the other
> criteria) and then any following times which meet the critera.  My basic
> approach follows this, after producing the DTSTART occurence, I get the
> next occurrence by incrementing the time based on the BYXXX and FREQ parts,
> and never consider times prior to DTSTART.
>
> I also think that the 'set' implied by BYSETPOS, is the set of occurrences
> meeting the other criteria within one increment of the FREQ value.

Exactly.

> For example, what should be produced if the DTSTART were 19970901?  I'd
> guess September 1, September 4 and October 7.

That's invalid iCalendar according to rfc2445bis, where DTSTART has to match 
the RRULE.

> And what if it were 19970905?  I guess in this case it would be September
> 5, October 7, and November 6.

Nope, the DTSTART has to match the rule in rfc2445bis. Sept 5 does not match 
the RRULE, so that would no longer be a valid iCalendar object.

However, if you relax the new requirement that DTSTART has to match RRULE, 
then yes, your results are correct in both cases.

> I'm thinking that in the case of having BYSETPOS, I need to start examining
> candidates at the beginning of the FREQ period containing DTSTART in order
> to compute the first set, and discard any occurrences prior to DTSTART,
> while ensuring that the DTSTART is included.
>
> Does this sound right?

Yes, exactly. In rfc2445bis, we also included a requirement that the DTSTART 
has to match the RRULE, so you definitely have to look at the whole month, 
irrespective of whether the DTSTART is some date within the month already.

Cheers,
Reinhold

- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, [email-masked], http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org