https://github.com/simpleweb/public_holidays
A ruby gem used by Tutorhub that provides helper functionality for working with dates in which public holidays are a concern
https://github.com/simpleweb/public_holidays
Last synced: 8 months ago
JSON representation
A ruby gem used by Tutorhub that provides helper functionality for working with dates in which public holidays are a concern
- Host: GitHub
- URL: https://github.com/simpleweb/public_holidays
- Owner: simpleweb
- License: mit
- Created: 2018-06-29T12:37:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-29T12:39:00.000Z (almost 8 years ago)
- Last Synced: 2025-03-02T03:41:38.520Z (over 1 year ago)
- Language: Ruby
- Size: 10.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Public Holidays
> Note: Project is in early development and the API is likely to change.
A gem that provides helper functionality for working with dates in which public holidays are a concern.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'public_holidays', :git => "git://github.com/adambutler/public_holidays.git", :branch => "master"
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install public_holidays
## Usage
Configure -
```ruby
PublicHolidays.configure do |config|
config.iso_3166_1 = "gb"
end
```
Get the next holiday from today -
```ruby
PublicHolidays.next
# => #
```
Get the next working day from today -
```ruby
PublicHolidays.next_working_day
# => #
```
Get the next working day from a specific date -
```ruby
from_date = Date.parse("2016/12/26")
PublicHolidays.next_working_day(from_date)
# => #
```
## Contributing
1. Fork it ( https://github.com/adambutler/public_holidays/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request