Subject: Re: More recurrence rule clarifications sought

From: Reinhold Kainhofer <[email-masked]>
Date: Thu, 5 May 2005 10:29:54 +0200

Laird Nelson wrote:
> Is the following recurrence specification legal?
>  
>   DTSTART:20050101T000000Z
>   RRULE:FREQ=YEARLY;BYMONTH=3;BYYEARDAY=9;BYWEEKNO=1;BYMONTHDAY=4

If I understand RRULE right, this rule says that the event occurs every year
on march 4, but only if if that day is the 9th day of the year and it is in
the first week of the year. Lots of contraditions there, so - apart from
the DTSTART - the event doesn't recur at all. (Note that BYYEARDAY=9 and 
BYWEEKNO=1 is not a contradition! E.g. in 2005 with WKST=MO, January 9 is in 
week no 1, because that's the first week that contains four days of 2005).

Note that all BY* rules are AND'ed together, not OR'ed. Otherwise the
example in rfc 2445 (sec. 4.3.10) would give a recurrence at all times when
the minutes are equal to 30, not just at 8:30 and 9:30

> I assume that if it is it would pick out the following dates within 2005
> (leaving aside times for now):
>  
>   January 1 (week number 1; day pulled from DTSTART)

No, not because of week number 1, but because that's the DTSTART, and the
DTSTART is always the first recurrence.

>   January 9 (picked out by BYYEARDAY adjustment)
>   March 4 (picked out by combination of BYMONTH and BYMONTHDAY
>   adjustments)

Nope, neither, because January 9 doesn't satiisfy the BYMONTH, and March4
doesn't satisfy the BYYEARDAY and the BYWEEKNO.

Cheers,
Reinhold

-- 
------------------------------------------------------------------
Reinhold Kainhofer, Vienna, Austria
email: [email-masked], http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at
 * K Desktop Environment, http://www.kde.org/, KOrganizer / KPilot maintainer

---

From: "Laird Nelson" <[email-masked]>
Date: Thu, 5 May 2005 14:00:47 -0400

> From: [email-masked] 
> [mailto:[email-masked]] On Behalf Of 
> Reinhold Kainhofer
> Note that all BY* rules are AND'ed together, not OR'ed. 
> Otherwise the example in rfc 2445 (sec. 4.3.10) would give a 
> recurrence at all times when the minutes are equal to 30, not 
> just at 8:30 and 9:30

Ah, right, of course.

Further question:

What is the next element in the recurrence set for this rule:

  DTSTART:20000131T000000Z
  RRULE:FREQ=MONTHLY

Is it February 29, 2000?

Thanks,
Laird

---

From: Sam Roberts <[email-masked]>
Date: Wed, 11 May 2005 22:25:56 -0400

> What is the next element in the recurrence set for this rule:

No, its Mar 31.

If applying an RRULE generates a time that can't exist, it doesn't
exist.

Cheers,
Sam