Skip to content
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

Support parse when start dates are in the past #20

Merged
merged 1 commit into from
Dec 8, 2017

Conversation

antogon
Copy link

@antogon antogon commented Oct 11, 2017

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: #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
@antogon antogon force-pushed the support-past-start-dates branch from a57dccb to 1a45b4c Compare October 11, 2017 20:53
@antogon
Copy link
Author

antogon commented Dec 6, 2017

@yb66 Any advice on how I could help expedite this PR/maintain this repo? I am a fan of the functionality it adds.

@yb66
Copy link
Owner

yb66 commented Dec 6, 2017

Hi @antogon,

I missed this as I was in the middle of moving when it came in, my sincere apologies. I'll give this a look later today and see what's what. As to helping maintain the repo, you help would be more than welcome, we can chat about that too.

iain

@yb66 yb66 merged commit 1a45b4c into yb66:master Dec 8, 2017
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.

2 participants