Subject: RE: BYDAY and YEARLY

From: kiwong <[email-masked]>
Date: Mon, 07 Jul 2003 13:43:21 -0700

RFC section 4.3.10
   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.

I will interpret 

RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 as the last Sunday in October
every year.

RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10,11,12 as the last Sunday in
October, Nov, Dec every year.

ki

> -----Original Message-----
> From: Dan Hickman [mailto:[email-masked]]
> Sent: Monday, July 07, 2003 12:16 PM
> To: [email-masked]
> Subject: BYDAY and YEARLY
> 
> 
> The correct usage of BYDAY in a yearly RRULE has been discussed several
> times on the working group before but I have not seen a resolution about
the
> correct meaning.  I would like to put it to rest once and for all.
> 
> The issue is the use of BYDAY as follows to mean the last Sunday in
October.
> RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
> 
> The BYDAY on yearly refers to weeks of the year and not weeks of the
month
> so this really means the last Sunday of the year but only if it occurs in
> October.  The last week of the year will always be in December of course
so
> the above rule never resolves to any valid dates.
> 
> The following examples would be correct:
> RRULE:FREQ=MONTHLY;BYDAY=-1SU;BYMONTH=10
> or
> RRULE:FREQ=YEARLY;BYDAY=SU;BYMONTH=10;BYSETPOS=-1
> 
> The problem is that RFC2445 incorrectly uses this syntax in VTIMEZONE
> examples so it makes it look like it is valid.  I am finding now that
both
> MS Outlook and Apple iCal both use YEARLY/BYDAY in this way.
> 
> It was suggested on this mailing list in the past that the VTIMEZONE text
> should be corrected in the RFC.  I really think this should be addressed,
> one way or another.
> 
> If the opinion is that "RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10" does
mean
> the last Sunday in October, then that raises further questions.  For
> example, what dates would the following rule resolve to?
> RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10,11,12
> 
> Regards,
> Dan Hickman
> Rockin' Software
> [email-masked]
> http://www.rockinsoftware.com

---

From: "Dan Hickman" <[email-masked]>
Date: Mon, 7 Jul 2003 16:05:13 -0500

But the from the same section 4.3.10
   Information, not contained in the rule, necessary to determine the
   various recurrence instance start time and dates are derived from the
   Start Time (DTSTART) entry attribute. For example,
   "FREQ=YEARLY;BYMONTH=1" doesn't specify a specific day within the
   month or a time. This information would be the same as what is
   specified for DTSTART.

Using your logic, the following RRULE example from the RFC would assume May
as the BYMONTH and would mean the 20th Monday in May.
     DTSTART;TZID=US-Eastern:19970519T090000
     RRULE:FREQ=YEARLY;BYDAY=20MO

This RFC sample RRULE states this is the 20th Monday of the Year.

Regards,
Dan Hickman
Rockin' Software

-----Original Message-----
From: kiwong [mailto:[email-masked]]
Sent: Monday, July 07, 2003 3:43 PM
To: Dan Hickman; [email-masked]
Subject: RE: BYDAY and YEARLY

RFC section 4.3.10

I will interpret

ki

the
October.
month
so
both
mean