Sha256: 52dd466d4e79c9353e5480ae2c91b5a2aa393a4c7cc50d894f5c406209345d52

Contents?: true

Size: 1.5 KB

Versions: 1

Compression:

Stored size: 1.5 KB

Contents

# WorkingCalendar

[![Gem Version](https://badge.fury.io/rb/working_calendar.svg)](https://rubygems.org/gems/working_calendar)
[![Build Status](https://travis-ci.org/gabynaiman/working_calendar.svg?branch=master)](https://travis-ci.org/gabynaiman/working_calendar)
[![Coverage Status](https://coveralls.io/repos/github/gabynaiman/working_calendar/badge.svg?branch=master)](https://coveralls.io/github/gabynaiman/working_calendar?branch=master)
[![Code Climate](https://codeclimate.com/github/gabynaiman/working_calendar.svg)](https://codeclimate.com/github/gabynaiman/working_calendar)

Working calendar specification

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'working_calendar'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install working_calendar

## Usage

```ruby
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](https://opensource.org/licenses/MIT).

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
working_calendar-0.1.0 README.md