Repository navigation
Conversation
HOURLY, MINUTELY and SECONDLY overwrote the timeset with the current hour/minute/second, so BYHOUR (and BYMINUTE/BYSECOND where they apply) had no effect. Per RFC 5545 these parts limit sub-daily frequencies, so skip periods whose time is not in the list. Fixes square#76
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #76.
Hourly,MinutelyandSecondlyreplace the timeset's hour/minute/second with the current date's, soBYHOUR(andBYMINUTE/BYSECONDwhere they limit) did nothing:FREQ=HOURLY;BYHOUR=9,17returned every hour.RFC 5545 says these parts limit sub-daily frequencies. Now
possible_daysreturns no day for a period whose hour/minute/second is not in the list. BYMINUTE/BYSECOND still expand for HOURLY (and BYSECOND for MINUTELY) as before.Tests: three specs in
rule_spec.rb(HOURLY + BYHOUR, MINUTELY + BYHOUR/BYMINUTE, SECONDLY + all three). They fail before; all 255 pass after, rubocop clean.I also compared 400 random HOURLY/MINUTELY/SECONDLY rules with BYHOUR/BYMINUTE/BYSECOND/BYDAY against python-dateutil: 296 differed before, none after (a few SECONDLY rules that span days are slow, as before).