Subject: RE: BYDAY and YEARLY

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

> -----Original Message-----
> From: Dan Hickman [mailto:[email-masked]]
> Sent: Monday, July 07, 2003 3:02 PM
> To: kiwong; [email-masked]
> Subject: RE: BYDAY and YEARLY
> 
> 
> You miss my point.  For yearly events, the BYMONTH is also derived from
> DTSTART.  For the sample, it would derive BYMONTH=5 since BYMONTH is not
> included in the RRULE.
> 

I don't think I miss your point. The RFC you quoted below is valid if the
recurring instance cannot be obtained by the RRULE, then use the DTSTART.
But the example RRULE:FREQ=YEARLY;BYDAY=20MO clearly defines the date of
the recurring instances, which are 20th Monday yearly. Whether it is in
May or not is not relevant because the date is already defined by the
RRULE.

ki

> Dan
> 
> > -----Original Message-----
> > From: Dan Hickman [mailto:[email-masked]]
> > Sent: Monday, July 07, 2003 2:05 PM
> > To: kiwong; [email-masked]
> > Subject: RE: BYDAY and YEARLY
> >
> >
> > 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
> >
> 
> But the day here is defined, which is the 20th Monday of the year.
> However, the time is not defined, so I will interpret it as 20th Monday
of
> the year at time 090000.

---

From: "Dan Hickman" <[email-masked]>
Date: Mon, 7 Jul 2003 19:54:44 -0500

So your saying if BYMONTH is specified then the integer on BYDAY is now
relative to a month instead of a year.  In my opinion, that is not at all
clear from the RFC.  I'm curious if everyone else agrees with the following:

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.

Regards,
Dan Hickman
Rockin' Software
[email-masked]
http://www.rockinsoftware.com

-----Original Message-----
From: [email-masked]
[mailto:[email-masked]]On Behalf Of kiwong
Sent: Monday, July 07, 2003 5:21 PM
To: Dan Hickman; [email-masked]
Subject: RE: BYDAY and YEARLY

ki

the
of

---

From: Jonathan Lennox <[email-masked]>
Date: Tue, 8 Jul 2003 08:49:19 -0400

> October, Nov, Dec every year.

I disagree.  This is the description of the intDAY grammar from RFC2445:

   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.

It's poorly worded, but clear when you read it; the integer applies to the
Nth occurence *within the interval*.  Also notice that in the grammar, ordwk
is defined as being in the range 1 to 53.

My code will resolve your two rules above as "no occurences other than
DTSTART" and "the last Sunday of the year" respectively, since the last
Sunday of the year always falls in December.

The rules with the descriptions you want are:
  RRULE:FREQ=MONTHLY;BYDAY=-1SU;BYMONTH=10
and
  RRULE:FREQ=MONTHLY;BYDAY=-1SU;BYMONTH=10,11,12

-- 
Jonathan Lennox
lennox at cs dot columbia dot edu