should DAILY with BYHOUR/BYMINUTE work properly?

87 views
Skip to first unread message

Chris Winters

unread,
Aug 5, 2011, 12:06:38 PM8/5/11
to google-rfc-2445
The RFC has this example (p 125):

Every 20 minutes from 9:00 AM to 4:40 PM every day:

DTSTART;TZID=US-Eastern:19970902T090000
RRULE:FREQ=DAILY;BYHOUR=9,10,11,12,13,14,15,16;BYMINUTE=0,20,40
or
RRULE:FREQ=MINUTELY;INTERVAL=20;BYHOUR=9,10,11,12,13,14,15,16

==> (September 2, 1997 EDT)9:00,9:20,9:40,10:00,10:20,
... 16:00,16:20,16:40
(September 3, 1997 EDT)9:00,9:20,9:40,10:00,10:20,
...16:00,16:20,16:40

If I try something similar to the former with the following
(serialized form of the RRule I programmatically built):

DTSTART;20110601T070000
RRULE:FREQ=DAILY;WKST=SU;INTERVAL=1;BYHOUR=7,16;BYMINUTE=0,0

the RecurrenceIterator returns only one instance per day, at 7 AM. I
assume this is because of the DTSTART, because if I change that to
'T060000' the iterator returns one instance per day at 6 AM.

This leads me to think that BYHOUR/BYMINUTE are ignored for DAILY
recurrences. I'll poke around in the code, but is that supposed to be
so?

Thanks,

Chris

Mike Samuel

unread,
Aug 10, 2011, 4:43:10 PM8/10/11
to google-...@googlegroups.com
There is no current support for iteration more frequently than daily
so it only works for BYHOUR, BYMINUTE, and BYSECOND clauses with zero
or one value.

Quite a few people seem to be requesting that feature recently, so I
think I'll just implement that.

Someone started contributing a patch for that and did a nice job, but
that stalled when we got to testing. I'll resurrect their work and
flesh out the tests.

I will send a mail to the list when it's in.

mike

2011/8/5 Chris Winters <chris....@gmail.com>:

> --
> You received this message because you are subscribed to the Google Groups "google-rfc-2445" group.
> To post to this group, send email to google-...@googlegroups.com.
> To unsubscribe from this group, send email to google-rfc-24...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-rfc-2445?hl=en.
>
>

Mike Samuel

unread,
Aug 12, 2011, 3:22:38 PM8/12/11
to google-rfc-2445
Chris,

I finished a first pass at hourly/secondly/minutely iteration. It is
committed as r34 ( http://code.google.com/p/google-rfc-2445/source/detail?r=34
) and is available at trunk.

This addresses iteration more frequently than daily in two ways.

(1) Now FREQ=HOURLY, FREQ=MINUTELY, and FREQ=SECONDLY are supported.
(2) Now BYHOUR, BYMINUTE, and BYSECOND rules with more than one value
are supported.

I believe that all the testcases in RFC 2445 now pass. There are no
testcases in the spec for BYSETPOS interaction with complicated
combinations of BY{HOUR,MINUTE,SECOND} so I cannot vouch for
correctness of frequent rules with BYSETPOS.

This is a fairly large change and I expect some instability as a
result, so I'm not pushing a new stable download yet.

If you want to play around with it see http://code.google.com/p/google-rfc-2445/wiki/BuildingFromSource
and http://google-rfc-2445.googlecode.com/svn/trunk/README.html

cheers,
mike
Reply all
Reply to author
Forward
0 new messages