{"action":"created","issue":{"url":"https://api.github.com/repos/seejohnrun/ice_cube/issues/281","labels_url":"https://api.github.com/repos/seejohnrun/ice_cube/issues/281/labels{/name}","comments_url":"https://api.github.com/repos/seejohnrun/ice_cube/issues/281/comments","events_url":"https://api.github.com/repos/seejohnrun/ice_cube/issues/281/events","html_url":"https://github.com/seejohnrun/ice_cube/issues/281","id":57563528,"number":281,"title":"Next Occurrences not Obeying Schedule","user":{"login":"taylorbrooks","id":117657,"avatar_url":"https://avatars.githubusercontent.com/u/117657?v=3","gravatar_id":"","url":"https://api.github.com/users/taylorbrooks","html_url":"https://github.com/taylorbrooks","followers_url":"https://api.github.com/users/taylorbrooks/followers","following_url":"https://api.github.com/users/taylorbrooks/following{/other_user}","gists_url":"https://api.github.com/users/taylorbrooks/gists{/gist_id}","starred_url":"https://api.github.com/users/taylorbrooks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taylorbrooks/subscriptions","organizations_url":"https://api.github.com/users/taylorbrooks/orgs","repos_url":"https://api.github.com/users/taylorbrooks/repos","events_url":"https://api.github.com/users/taylorbrooks/events{/privacy}","received_events_url":"https://api.github.com/users/taylorbrooks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-13T06:14:00Z","updated_at":"2016-01-31T04:13:50Z","closed_at":null,"body":"I'm not sure what's going one here, but it doesn't seem like `next_occurrences` is obeying this recurring rule logic:\r\n\r\n````ruby\r\nhash = {\"validations\"=>{\"day\"=>[]}, \"rule_type\"=>\"IceCube::WeeklyRule\", \"interval\"=>2, \"until\"=>nil, \"count\"=>nil}\r\n````\r\nSo I turn the hash into an IceCube rule...\r\n````ruby\r\n$ rule = IceCube::Rule.from_hash hash\r\n=> #<IceCube::WeeklyRule:0x007fb4b5bb39f8\r\n @interval=2,\r\n @uses=0,\r\n @validations=\r\n  {:interval=>[#<IceCube::Validations::WeeklyInterval::Validation:0x007fb4b5bb31b0 @interval=2, @week_start=:sunday>],\r\n   :base_hour=>[#<IceCube::Validations::ScheduleLock::Validation:0x007fb4b5bb3750 @type=:hour>],\r\n   :base_min=>[#<IceCube::Validations::ScheduleLock::Validation:0x007fb4b5bb36b0 @type=:min>],\r\n   :base_sec=>[#<IceCube::Validations::ScheduleLock::Validation:0x007fb4b5bb3610 @type=:sec>]},\r\n @week_start=:sunday>\r\n````\r\nThen I create a schedule...\r\n````ruby\r\n$ sched = IceCube::Schedule.new Date.today\r\n=> #<IceCube::Schedule:0x007fb4b7214a80 @all_exception_rules=[], @all_recurrence_rules=[], @start_time=2015-02-13 00:00:00 -0600>\r\n````\r\nAdd the rule\r\n````ruby\r\n$ sched.add_recurrence_rule rule\r\n=> [#<IceCube::WeeklyRule:0x007fb4b5bb39f8\r\n  @interval=2,\r\n  @uses=0,\r\n  @validations=\r\n   {:interval=>[#<IceCube::Validations::WeeklyInterval::Validation:0x007fb4b5bb31b0 @interval=2, @week_start=:sunday>],\r\n    :base_hour=>[#<IceCube::Validations::ScheduleLock::Validation:0x007fb4b5bb3750 @type=:hour>],\r\n    :base_min=>[#<IceCube::Validations::ScheduleLock::Validation:0x007fb4b5bb36b0 @type=:min>],\r\n    :base_sec=>[#<IceCube::Validations::ScheduleLock::Validation:0x007fb4b5bb3610 @type=:sec>]},\r\n  @week_start=:sunday>]\r\n````\r\nAnd inspect the next 20 occurrences\r\n````ruby\r\n$ sched.next_occurrences 20\r\n=> [Sat, 14 Feb 2015 00:00:00 UTC +00:00,\r\n Sun, 22 Feb 2015 00:00:00 UTC +00:00,\r\n Mon, 23 Feb 2015 00:00:00 UTC +00:00,\r\n Tue, 24 Feb 2015 00:00:00 UTC +00:00,\r\n Wed, 25 Feb 2015 00:00:00 UTC +00:00,\r\n Thu, 26 Feb 2015 00:00:00 UTC +00:00,\r\n Fri, 27 Feb 2015 00:00:00 UTC +00:00,\r\n Sat, 28 Feb 2015 00:00:00 UTC +00:00,\r\n Sun, 08 Mar 2015 00:00:00 UTC +00:00,\r\n Mon, 09 Mar 2015 00:00:00 UTC +00:00,\r\n Tue, 10 Mar 2015 00:00:00 UTC +00:00,\r\n Wed, 11 Mar 2015 00:00:00 UTC +00:00,\r\n Thu, 12 Mar 2015 00:00:00 UTC +00:00,\r\n Fri, 13 Mar 2015 00:00:00 UTC +00:00,\r\n Sat, 14 Mar 2015 00:00:00 UTC +00:00,\r\n Sun, 22 Mar 2015 00:00:00 UTC +00:00,\r\n Mon, 23 Mar 2015 00:00:00 UTC +00:00,\r\n Tue, 24 Mar 2015 00:00:00 UTC +00:00,\r\n Wed, 25 Mar 2015 00:00:00 UTC +00:00,\r\n Thu, 26 Mar 2015 00:00:00 UTC +00:00]\r\n````\r\nWhat am I missing here?\r\n\r\nWhat does it show a week of consecutive days?"},"comment":{"url":"https://api.github.com/repos/seejohnrun/ice_cube/issues/comments/177380451","html_url":"https://github.com/seejohnrun/ice_cube/issues/281#issuecomment-177380451","issue_url":"https://api.github.com/repos/seejohnrun/ice_cube/issues/281","id":177380451,"user":{"login":"avit","id":4278,"avatar_url":"https://avatars.githubusercontent.com/u/4278?v=3","gravatar_id":"","url":"https://api.github.com/users/avit","html_url":"https://github.com/avit","followers_url":"https://api.github.com/users/avit/followers","following_url":"https://api.github.com/users/avit/following{/other_user}","gists_url":"https://api.github.com/users/avit/gists{/gist_id}","starred_url":"https://api.github.com/users/avit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avit/subscriptions","organizations_url":"https://api.github.com/users/avit/orgs","repos_url":"https://api.github.com/users/avit/repos","events_url":"https://api.github.com/users/avit/events{/privacy}","received_events_url":"https://api.github.com/users/avit/received_events","type":"User","site_admin":false},"created_at":"2016-01-31T04:13:50Z","updated_at":"2016-01-31T04:13:50Z","body":"Late reply, I know. Sorry, I'm just getting back to this project again.\r\n\r\nThat. Is. Weird. It looks like the rule from hash is missing a `:base_wday` validation. We should fix that."}}