https://github.com/sixarm/sixarm_ruby_date_days
SixArm.com » Ruby » Date methods for days
https://github.com/sixarm/sixarm_ruby_date_days
date days gem ruby
Last synced: over 1 year ago
JSON representation
SixArm.com » Ruby » Date methods for days
- Host: GitHub
- URL: https://github.com/sixarm/sixarm_ruby_date_days
- Owner: SixArm
- License: other
- Created: 2014-03-26T08:26:56.000Z (over 12 years ago)
- Default Branch: main
- Last Pushed: 2023-09-15T19:27:55.000Z (almost 3 years ago)
- Last Synced: 2025-02-06T00:25:43.950Z (over 1 year ago)
- Topics: date, days, gem, ruby
- Language: Ruby
- Size: 229 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# SixArm.com → Ruby →
Date methods for days
[](http://badge.fury.io/rb/sixarm_ruby_date_days)
[](https://travis-ci.org/SixArm/sixarm_ruby_date_days)
[](https://codeclimate.com/github/SixArm/sixarm_ruby_date_days/maintainability)
* Git:
* Doc:
* Gem:
* Contact: Joel Parker Henderson,
* Project: [changes](CHANGES.md), [license](LICENSE.md), [contributing](CONTRIBUTING.md).
## 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
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'