[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
dhickman@xxxxxxxxxxxxxxxxxx
http://www.rockinsoftware.com