[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: BYDAY and YEARLY
On Tuesday, July 8 2003, "Bruce_Kahn@xxxxxxxxxxxxxxxx" wrote to "ietf-calendar@xxxxxxx" saying:
> Thus evaluating the rule:
>
> RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
>
> You start with DTSTART and apply the FREQ and INTERVAL to get "Repeats
> yearly on the DTSTART date/time".
>
> Then you apply the BYxxx rule parts in the order proscribed. The first
> would be BYMONTH resulting in "Repeats yearly on the DTSTART date/time in
> the month of October" (the day and time are inherited, the month is
> overridden by BYMONTH). The next step would be to apply the next BYxxx
> rule part we have, BYDAY. This would result in "Repeats yearly on the
> Last Sunday (at the DTSTART time) in the month of October".
I agree with this so far, but in your next step (concluding that this means
"the last Sunday in October") you make an unwarranted leap. The definition
of the integer parts of BYDAY says, as you quoted previously:
> Each BYDAY value can also be preceded by a positive (+n) or negative
> (-n) integer. If present, this indicates the nth occurrence of the
> specific day within the MONTHLY or YEARLY RRULE.
Thus, since this is a YEARLY RRULE, the phrase "Last Sunday" means "Last
Sunday of the Year", not "Last Sunday of the Month." The presence of a
BYMONTH rule doesn't affect this; by the spec, the integer part of BYDAY
depends *only* on the FREQ.
There is, of course, no last Sunday of the Year in October. But this just
means that the quoted rule is vacuous, and its recurrence defines the empty
set, except for its DTSTART. There's nothing "wrong" with that, any more
than there's something "wrong" with
RRULE:FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=30
--
Jonathan Lennox
lennox at cs dot columbia dot edu