{"action":"created","issue":{"url":"https://api.github.com/repos/siebertm/parse-cron/issues/28","repository_url":"https://api.github.com/repos/siebertm/parse-cron","labels_url":"https://api.github.com/repos/siebertm/parse-cron/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/siebertm/parse-cron/issues/28/comments","events_url":"https://api.github.com/repos/siebertm/parse-cron/issues/28/events","html_url":"https://github.com/siebertm/parse-cron/issues/28","id":137930042,"number":28,"title":"Bad calculation","user":{"login":"jmlfr","id":17597967,"avatar_url":"https://avatars.githubusercontent.com/u/17597967?v=3","gravatar_id":"","url":"https://api.github.com/users/jmlfr","html_url":"https://github.com/jmlfr","followers_url":"https://api.github.com/users/jmlfr/followers","following_url":"https://api.github.com/users/jmlfr/following{/other_user}","gists_url":"https://api.github.com/users/jmlfr/gists{/gist_id}","starred_url":"https://api.github.com/users/jmlfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmlfr/subscriptions","organizations_url":"https://api.github.com/users/jmlfr/orgs","repos_url":"https://api.github.com/users/jmlfr/repos","events_url":"https://api.github.com/users/jmlfr/events{/privacy}","received_events_url":"https://api.github.com/users/jmlfr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-02T16:54:08Z","updated_at":"2016-03-19T12:09:23Z","closed_at":null,"body":"There is a bad calculation if I set more complex crontab. Here is an example.\r\n\r\n2.2.4 :001 > require 'cron_parser'\r\n => true\r\n2.2.4 :002 > require 'time'\r\n => true\r\n2.2.4 :003 > cron_parser = CronParser.new('1 2 8-15 * 4')\r\n => #<CronParser:0x000000009644e8 @source=\"1 2 8-15 * 4\", @time_source=Time>\r\n2.2.4 :004 > cron_parser.next(Time.parse('2016-03-01 00:00'))\r\n => 2016-03-03 02:01:00 +0100\r\n\r\nIt should be '2016-03-10 02:01:00' I think."},"comment":{"url":"https://api.github.com/repos/siebertm/parse-cron/issues/comments/198691826","html_url":"https://github.com/siebertm/parse-cron/issues/28#issuecomment-198691826","issue_url":"https://api.github.com/repos/siebertm/parse-cron/issues/28","id":198691826,"user":{"login":"meesterdude","id":931048,"avatar_url":"https://avatars.githubusercontent.com/u/931048?v=3","gravatar_id":"","url":"https://api.github.com/users/meesterdude","html_url":"https://github.com/meesterdude","followers_url":"https://api.github.com/users/meesterdude/followers","following_url":"https://api.github.com/users/meesterdude/following{/other_user}","gists_url":"https://api.github.com/users/meesterdude/gists{/gist_id}","starred_url":"https://api.github.com/users/meesterdude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meesterdude/subscriptions","organizations_url":"https://api.github.com/users/meesterdude/orgs","repos_url":"https://api.github.com/users/meesterdude/repos","events_url":"https://api.github.com/users/meesterdude/events{/privacy}","received_events_url":"https://api.github.com/users/meesterdude/received_events","type":"User","site_admin":false},"created_at":"2016-03-19T12:09:23Z","updated_at":"2016-03-19T12:09:23Z","body":"Actually, that appears to be the spec! that's just wild. So the logic is \"the first, the 15th, or any friday\" scheduling wise - I don't know why I'd want that. Or anyone. Meanwhile if it were AND, you could do things like \"the first tuesday of the month\". \r\n\r\nI'll take a look at adding a flag to support the variation for those of us who want it to facilitate this kind of behavior while leaving the default behavior to meet the spec - and call out the subtly in the docs. "}}