-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The :now option doesn't seem to work very well #4
Comments
Yes, some of the options weren't being passed on properly before, the parsing code was a bit too complex so arguments were being silently ignored. In the develop branch there are new specs in the Regards, |
Based on the specs it seems to work in the develop branch if also passing the same date with the |
Prior to this change, Tickle would throw an error if the start option passed in was in the past with respect to `Date.today`. When attempting to enumerate intervals of dates that have already occurred (in the case of looking backwards in a calendar), it is important to be able to parse Tickle expressions and determine what the next occurrence _was_ as opposed to when it _will be_. While it appears that the parse API already supports a `:now` option, it seems this option is ignored when checking this condition and, instead, a `Date.today` is used. This change simply uses the `:now` as is passed to the `Tickled` object to validate `start_date`. Since `Tickled#now` defaults to `Time.now`, this change is minimal but does add value to the gem. References: yb66#4
Prior to this change, Tickle would throw an error if the start option passed in was in the past with respect to `Date.today`. When attempting to enumerate intervals of dates that have already occurred (in the case of looking backwards in a calendar), it is important to be able to parse Tickle expressions and determine what the next occurrence _was_ as opposed to when it _will be_. While it appears that the parse API already supports a `:now` option, it seems this option is ignored when checking this condition and, instead, a `Date.today` is used. This change simply uses the `:now` as is passed to the `Tickled` object to validate `start_date`. Since `Tickled#now` defaults to `Time.now`, this change is minimal but does add value to the gem. References: yb66#4
I have an app that supports cancelling the next occurrence of an event, but for this we need to calculate the next occurrence of the event for an event in the future, i.e.:
The text was updated successfully, but these errors were encountered: