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

Document next_business_day and previous_business_day in the README #146

Open
roryokane opened this issue Dec 9, 2022 · 0 comments · May be fixed by #175
Open

Document next_business_day and previous_business_day in the README #146

roryokane opened this issue Dec 9, 2022 · 0 comments · May be fixed by #175

Comments

@roryokane
Copy link

#next_business_day and #previous_business_day are useful public methods of Business::Calendar:

# Roll forward to the next business day regardless of whether the given
# date is a business day or not.
def next_business_day(date)
loop do
date += day_interval_for(date)
break date if business_day?(date)
end
end
# Roll backward to the previous business day regardless of whether the given
# date is a business day or not.
def previous_business_day(date)
loop do
date -= day_interval_for(date)
break date if business_day?(date)
end
end

The README’s “Business day arithmetic” section does not document those methods. It should.

Where I think this documentation belongs in that section of the README:

  • Business day arithmetic
    • ⚠️ next_business_day – documentation needed
    • ⚠️ previous_business_day – documentation needed
    • add_business_days
    • subtract_business_days
    • roll_forward
    • roll_backward
    • business_days_between
Darhazer added a commit to Darhazer/business that referenced this issue Mar 29, 2024
@Darhazer Darhazer linked a pull request Mar 29, 2024 that will close this issue
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 a pull request may close this issue.

1 participant