dmfs / lib-recur

A recurrence processor for Java
Apache License 2.0
195 stars 47 forks source link

Hour, Minute and Second are not expanded properly #7

Closed yahrens closed 10 years ago

yahrens commented 11 years ago

Given a time string with a freq > hourly, the BY[HOUR, MINUTE, SECOND] parameter is not interpreted correctly.

Example:

"FREQ=MONTHLY;UNTIL=20120131T120000;BYHOUR=12"

with the start date

"20120101T000000"

should result in 31 + 1 instances. However, only 2 instances are created.

dmfs commented 10 years ago

It's actually correct behavior. RFC 5545 says:

      Information, not contained in the rule, necessary to determine the
      various recurrence instance start time and dates are derived from
      the Start Time ("DTSTART") component 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".

So the day should be derived from DTSTART and only 2 instances should be iterated (one for the start and one at 12:00 the same day)