Description
- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the documentation and believe that my question is not covered.
Feature Request
I've searched the issue tracker and I'm surprised this enhancement hasn't been requested! Maybe because it's hard and tricky to implement. I love pendulum and I'm going to create a PR for this, but I'm learning Python so putting it out into the ether for professional programers or the maintainers of pendulum to add this faster than I ever could. The feature is to add a business days parameter added to the pendulum.date().add()
and pendulum.datetime().add()
method etc... As an example:
>>> import pendulum as p
>>> p.date(2020, 12, 22).add(days=10)
>>> datetime.date(2021, 1, 1)
>>> # The business day feature would look like:
>>> p.date(2020, 12, 22).add(bdays=10)
>>> datetime.date(2021, 1, 7)
This is U.S. Specific. So business days will account for U.S. Bank holidays and Weekends when Banks are closed. So with that said the second example with the bdays
parameter will not count Christmas, New Year's holiday or Saturday and Sunday and that's why the datetime is 2021-01-07 and not 2021-01-01. I know this is a tall ask, I'm working on a PR for this, but if anyone who's savvy and want to take a crack at this, go right ahead. I really think this would be a nice enhancement and make pendulum the defacto Python datetime module if it added this business days parameter. Thank you for you consideration and have a good one!