[Ietf-calsify] BYDAY integers with other BY* rules (was: BYSETPOS and contracting BY* rules)

Jonathan Lennox lennox at cs.columbia.edu
Tue Nov 7 06:55:04 PST 2006


On Tuesday, November 7 2006, "Reinhold Kainhofer" wrote to "ietf-calsify at osafoundation.org" saying:

> AFAIU RFC 2445, the -1FR means the last friday in the set of dates that match 
> the rule evaluation so far. Thus, I get the same results as with BYSETPOS:

I've always agreed with your second interpretation of RFC 2445: the numbers
in the BYDAY rule refer to the period of time described by the FREQ.  "-1FR"
means the last Friday of the month in a MONTHLY rule, and the last Friday of
the year in a YEARLY rule.

This seems to me to be the most straightforward reading of the BYDAY
definition:

      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.
      For example, within a MONTHLY rule, +1MO (or simply 1MO)
      represents the first Monday within the month, whereas -1MO
      represents the last Monday of the month.  If an integer modifier
      is not present, it means all days of this type within the
      specified frequency.  For example, within a MONTHLY rule, MO
      represents all Mondays within the month.

That would indeed mean that the other BY* rules in the rule aren't relevant
to the interpretation of BYDAY, and that the order of interpretation of BY*
rules other than BYSETPOS isn't important.

Unfortunately, this interpretation is directly contradicted by RFC 2445's
VTIMEZONE example, which describes US-Eastern DST transitions as

        RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10

I've always interpreted this VTIMEZONE example as a bug in the spec, but I
see how it can make sense if BYDAY integers are interpreted as being like
BYSETPOS.

What do other implementations do?

-- 
Jonathan Lennox
lennox at cs.columbia.edu


More information about the Ietf-calsify mailing list