Skip to content

Commit

Permalink
Add a note on calendar names to README
Browse files Browse the repository at this point in the history
  • Loading branch information
ineu committed Mar 9, 2021
1 parent 2335438 commit 2d06a66
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ gem "business", "~> 2.0"

Get started with business by creating an instance of the calendar class, that accepts a hash that specifies which days of the week are considered working days, which days are holidays and which are extra working dates.

Additionally each calendar instance can be given a name. This can come in handy if you use multiple calendars.

```ruby
calendar = Business::Calendar.new(
name: 'my calendar',
working_days: %w( mon tue wed thu fri ),
holidays: ["01/01/2014", "03/01/2014"], # array items are either parseable date strings, or real Date objects
extra_working_dates: [nil], # Makes the calendar to consider a weekend day as a working day.
Expand Down

0 comments on commit 2d06a66

Please sign in to comment.