WorkingCalendar

Gem Version CI Coverage Status Code Climate

Working calendar specification

Installation

Add this line to your application's Gemfile:

gem 'working_calendar'

And then execute:

$ bundle

Or install it yourself as:

$ gem install working_calendar

Usage

calendar = WorkingCalendar.new '-0600'

# Working
calendar.add_working_week_day :monday, '09:00' => '18:00'
calendar.add_working_date '2018-12-29', '10:00' => '14:00'

# Not working
calendar.add_not_working_week_day :monday, '13:00' => '14:00'
calendar.add_not_working_date '2018-12-31', '10:00' => '14:00'


calendar.working_at? Time.parse('2018-12-17T12:35:00-0600') # => true
calendar.working_at? Time.parse('2018-12-31T13:35:00-0600') # => false

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/gabynaiman/working_calendar.

License

The gem is available as open source under the terms of the MIT License.