An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# SixArm.com → Ruby →
Date methods for days

[![Gem Version](https://badge.fury.io/rb/sixarm_ruby_date_days.svg)](http://badge.fury.io/rb/sixarm_ruby_date_days)
[![Build Status](https://travis-ci.org/SixArm/sixarm_ruby_date_days.png)](https://travis-ci.org/SixArm/sixarm_ruby_date_days)
[![Code Climate](https://api.codeclimate.com/v1/badges/dbe3183cd4dbd0bb3b00/maintainability)](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'