Skip to content

grsmv/week

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Simple gem to work with weeks as arrays of day numbers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages