Skip to content

SixArm/sixarm_ruby_date_days

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SixArm.com → Ruby →
Date methods for days

Gem Version Build Status Code Climate

Introduction

Extend the Ruby Date class with methods for workweek days and weekend days:

date.workweek? 
#=> true when the date is Monday through Friday.

date.weekend? 
#=> true when the date is Saturday or Sunday.

We also provide constants:

Date::WEEKEND_WDAYS #=> [0, 6]
Date::WEEKEND_DAYNAMES #=> ["Sunday", "Saturday"]
Date::WEEKEND_ABBR_DAYNAMES #=> ["Sun", "Sat"]

Date::WORKWEEK_WDAYS #=> [1, 2, 3, 4, 5]
Date::WORKWEEK_DAYNAMES #=> ["Monday", "Tuesday", ...]
Date::WORKWEEK_ABBR_DAYNAMES #=> ["Mon", "Tue", ...]

Date::WDAYS #=> [0, 1, 2, 3, 4, 5, 6]

For docs go to http://sixarm.com/sixarm_ruby_date_days/doc

Want to help? We're happy to get pull requests.

Install

Gem

To install this gem in your shell or terminal:

gem install sixarm_ruby_date_days

Gemfile

To add this gem to your Gemfile:

gem 'sixarm_ruby_date_days'

Require

To require the gem in your code:

require 'sixarm_ruby_date_days'

About

SixArm.com » Ruby » Date methods for days

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages