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 Business Day arithmetic #3

Open
choptastic opened this issue Sep 1, 2013 · 3 comments
Open

Add Business Day arithmetic #3

choptastic opened this issue Sep 1, 2013 · 3 comments

Comments

@choptastic
Copy link
Owner

Per the recommendation from @RomanShestakov, add business day arithmetic.

This will require either accepting a list of business days, or more likely, have a predicate function passed to it which would evaluate whether or not a date is a business day.

This would work with the Modifier in #1 by adding three new date units: business_day and business_week, business_month

  • business_day would check each day, only decrementing the counter if the day is actually a business day.
  • business_week will increment like a normal week, and then continue incrementing each day until it finds the first business day. Example: Assume today is monday, and next monday is a holiday: 1 business week would be next tuesday, while 2 business weeks would just be two mondays from now.
  • business_month will work exactly like business_week, except it increments the month.

In short: business_week and business_month would do valid-business-day checks only at the end, while business_day does one for each day.

@RomanShestakov
Copy link

Awesome! Thanks a lot
Regards, Roman

Sent from my iPhone

On 1 Sep 2013, at 02:36, Jesse Gumm [email protected] wrote:

Per the recommendation from @RomanShestakov, add business day arithmetic.

This will require either accepting a list of business days, or more likely, have a predicate function passed to it which would evaluate whether or not a date is a business day.

This would work with the Modifier in #1 by adding three new date units: business_day and business_week, business_month

business_day would check each day, only decrementing the counter if the day is actually a business day.
business_week will increment like a normal week, and then continue incrementing each day until it finds the first business day. Example: Assume today is monday, and next monday is a holiday: 1 business week would be next tuesday, while 2 business weeks would just be two mondays from now.
business_month will work exactly like business_week, except it increments the month.
In short: business_week and business_month would do valid-business-day checks only at the end, while business_day does one for each day.


Reply to this email directly or view it on GitHub.

@marutha
Copy link

marutha commented Jan 17, 2017

+1 any updates on this?

@choptastic
Copy link
Owner Author

Not yet. I haven't had the immediate need in my apps yet for it, so the priority of building it has fallen in lieu of more immediate needs.

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