#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
#next_business_dayand#previous_business_dayare useful public methods ofBusiness::Calendar:business/lib/business/calendar.rb
Lines 106 to 122 in 936546b
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:
next_business_day– documentation neededprevious_business_day– documentation neededadd_business_dayssubtract_business_daysroll_forwardroll_backwardbusiness_days_between