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

Consecutive work- and non-working days #139

Open
xlts opened this issue Sep 22, 2016 · 6 comments
Open

Consecutive work- and non-working days #139

xlts opened this issue Sep 22, 2016 · 6 comments

Comments

@xlts
Copy link
Contributor

xlts commented Sep 22, 2016

The project I'm working on requires us to calculate consecutive working or non-working days around a given date, e.g. called for non-working days on a Sunday (say Sept. 25, 2016) we would expect to get a period of work-free days around this date (in this case Sept. 24 and Sept. 25 - a Saturday and a Sunday). In our case, this feature is vital as it often happens that there is a public holiday right after weekend (or a week is scattered with occasional public holidays) and we needed a simple interface that would return such an array of dates. Naturally, the implementation is straightforward but still it feels that it should be part of this gem. Wondering if such a feature would be fit for this library.

@craiglittle
Copy link

@xlts I think the clavius gem might provide the behavior you're looking for. Check out the Clavius.between method.

@xlts
Copy link
Contributor Author

xlts commented Sep 27, 2016

@craiglittle thanks for your suggestion, however this would work if I knew the exact range of dates in which I could look for work/non-working days in the first place. In this case I'm not able to make such assumptions and I'm looking for a more general solution, hence this issue.

@craiglittle
Copy link

I'm interested in the problem you're trying to solve, but I'm not quite sure I follow what you're looking for.

Could you provide a rough sketch of the API and expected response(s)?

There's a possibility of adding the feature to clavius (and biz) if it makes sense.

@xlts
Copy link
Contributor Author

xlts commented Sep 28, 2016

@craiglittle I already forked business_time and added the desired implemetation, which is what I'm using in my project; have a look: xlts@5bdeec8. Although business_time is best suited to my project's other needs, I can by all means see this feature integrated within clavius or biz.

@bokmann
Copy link
Owner

bokmann commented Apr 1, 2017

If you have this working in a fork, I'd love to see a pull request.

@xlts
Copy link
Contributor Author

xlts commented Apr 2, 2017

@bokmann absolutely, pull request is ready for review: #154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants