Skip to content

Implement SECONDLY and MINUTELY recurrence frequencies - #782

Open
gaoflow wants to merge 1 commit into
sabre-io:masterfrom
gaoflow:implement-secondly-minutely-frequencies
Open

Implement SECONDLY and MINUTELY recurrence frequencies#782
gaoflow wants to merge 1 commit into
sabre-io:masterfrom
gaoflow:implement-secondly-minutely-frequencies

Conversation

@gaoflow

@gaoflow gaoflow commented Jul 29, 2026

Copy link
Copy Markdown

FREQ=SECONDLY and FREQ=MINUTELY are accepted by parseRRule() and listed in the class docblock, but next() has no case for either and no nextSecondly()/nextMinutely() exists, so currentDate never advances. Two results on ordinary valid input:

  • FREQ=MINUTELY;COUNT=4 returns four copies of the start instead of minute-spaced instants.
  • FREQ=MINUTELY;UNTIL=... loops forever — valid() stays true while currentDate never passes until. Same for SECONDLY.

Both methods advance by the interval and apply the BYHOUR/BYMINUTE limits (plus BYSECOND for secondly), mirroring the do/while filtering nextDaily() already uses; the dateUpperLimit guard stops an unsatisfiable BY combination from hanging.

This covers the LIMIT rules for these two frequencies (RFC 5545 §3.3.10). The EXPAND cases are left as follow-up: BYSECOND under MINUTELY, and BYMINUTE/BYSECOND under HOURLY and coarser frequencies (which is why FREQ=HOURLY;BYMINUTE=0,30 still yields one instance per hour) — those need an expansion pass the iterator doesn't have yet.

Tests cover COUNT- and UNTIL-bounded cases for both frequencies, INTERVAL, and the BYHOUR/BYMINUTE/BYSECOND limits; the UNTIL tests are capped so they can't hang.

parseRRule() accepts FREQ=SECONDLY and FREQ=MINUTELY (both valid per RFC 5545
section 3.3.10, and listed in the class docblock), but next() had no case for
either and no nextSecondly()/nextMinutely() existed, so currentDate never
advanced. A bounded rule such as FREQ=MINUTELY;UNTIL=... looped forever, and a
FREQ=MINUTELY;COUNT=4 rule returned four copies of the start.

Add both, advancing by the interval and applying the BYHOUR/BYMINUTE limits
(and BYSECOND for secondly), mirroring the do/while filtering already used by
nextDaily(). The dateUpperLimit guard prevents an unsatisfiable BY combination
from hanging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant