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

Add helper for generating periods on a date #105

Merged
merged 2 commits into from
May 19, 2017
Merged

Conversation

craiglittle
Copy link
Collaborator

This makes it much more straightforward to answer common questions such as "What was the first business time today?" or "What is the last business time today?".

Further, more docs have been added to show how to calculate the previous or next business time from a given point in time, which is another common operation.

Closes #102.

@zendesk/darko

/cc @jakcharlton

This makes it much more straightforward to answer questions like "What
was the first business time today?" or "What is the last business time
today?".

Having to call `to_a` in order to retrieve the last period on a date is
a bit clunky, but I wanted the API to remain consistent with how
`#before` and `#after` currently work. For the next major version, this
will most likely be changed so all three methods resolve the lazy
enumerator before returning.
This is a common question answered by business-hours gems, so we should
show how to answer it.
@craiglittle craiglittle merged commit b8763f6 into master May 19, 2017
@craiglittle craiglittle deleted the craig/day-periods branch May 19, 2017 03:24
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