Description
business is a Ruby library for business date calculations based on business calendars. You create a calendar from a hash that says which days of the week are working days, which dates are holidays and which dates are extra working dates, and you can give each calendar a name, which helps if you use several. Calendars can also be written as YAML files, kept in a folder such as lib/calendars, and added to the library with the load_paths method, which also accepts plain Ruby hashes. Holidays and extra working dates can be strings that Date.parse understands or values in YYYY-MM-DD form. Business::Calendar.load opens a calendar by name, and load_cached avoids parsing the file more than once. The README covers checking whether a date is a business day, business day arithmetic, and compatibility, and it has a section on other libraries that already handle this. You can install the gem with the command in the README or through a Gemfile entry, and the project is public on GitHub.…
Highlights
- Business day calculations from calendars
- Working days, holidays and extra working dates
- Calendars defined in YAML files
- Cached calendar loading
- Business day arithmetic
Ratings & Reviews
No ratings yet
Be the first to rate Business.
People also visit
Make a Calendar Studio
Design calendars and schedules, then export crisp documents offline
Business FAQ
What does business do?
It works out business days using a calendar that defines working days, holidays and extra working dates.
How do I define a calendar?
Either as a Ruby hash passed to the calendar class, or as a YAML file loaded with load_paths.
What format can holiday dates take?
Strings that Date.parse can understand, or YYYY-MM-DD values, which Ruby YAML reads as dates.
How do I install it?
Use the install command shown in the README, or add it to your Gemfile as the README describes.
What are the best Business alternatives?
Popular alternatives to Business include Day-Number, Simple Calendar and JW Calendar. See all Business alternatives




