Low commit activity in last 3 years
No release in over a year
Working calendar specification
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.8
~> 0.2
~> 11.0
~> 0.12
~> 5.0, < 5.11

Runtime

 Project Readme

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.