Skip to content

Latest commit

 

History

History
executable file
·
41 lines (26 loc) · 738 Bytes

README.md

File metadata and controls

executable file
·
41 lines (26 loc) · 738 Bytes

Build Status

Description:

A simple gem to work with weeks as arrays of date objects. It works with commercial dates (according to http://en.wikipedia.org/wiki/ISO_week_date).

Usage:

Simple:

week(2011, 52).map { |day| p day }

# =>
# Sun Dec 25 00:00:00 +0200 2011
# (...)
# Sat Dec 31 00:00:00 +0200 2011

Without any parameters:

week.map { |day| p day }

With Monday as first day of the week:
(1 as third parameter)

week(2011, 8, 1).map { |day| p day }

Patch for standart library Date class:

Date.new(2011, 12, 25).week

Copyright (c) 2011 Sergey Gerasimov