Skip to content

Document next_business_day and previous_business_day in the README #146

Description

@roryokane

#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions