Skip to content

Different date operations, primarily around business days

License

Notifications You must be signed in to change notification settings

msc01/dateoperations

Repository files navigation

DateOperations

Get more details at codescene.io.

Overview

Different date operations, primarily around business days; based on the Holidays Gem.

Synopsis

DateOperations.[...]

Installation

Download the gem, then install it:

gem install dateoperations.gemspec

Examples

require 'dateoperations'
...
DateOperations.country #=> :de

DateOperations.holiday?(Date.new(2016, 10, 3)) #=> true

DateOperations.country = :us #=> :us
DateOperations.holiday?(Date.new(2016, 10, 3)) # => false

DateOperations.country = :de #=> :de
DateOperations.number_of_business_days_between(Date.new(2016, 10, 1), Date.new(2016, 10, -1)) #=> 20

DateOperations.country = :au #=> :au
DateOperations.number_of_business_days_between(Date.new(2016, 10, 1), Date.new(2016, 10, -1)) #=> 21

DateOperations.weekend?(DateOperations.weekend?(Date.new(2016, 6, 18)) #=> true

Documentation

Documentation

About

Different date operations, primarily around business days

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages