Project

sane_week

0.0
No commit activity in last 3 years
No release in over 3 years
A simple gem for weeks starting on monday
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Gem Version A simple week utility class for ruby. a week always starts on a monday, and will give you the dates for each day of the week.

week = Week.new # not specifying a date defaults to the current date
week.start_date # => Whatever Date.today is

week2 = Week.new(Date.new(2014, 10, 7))
week2.monday   # => #<Date: 2014-10-06 ((2456937j,0s,0n),+0s,2299161j)>
week2.monday.httpdate # => "Mon, 06 Oct 2014 00:00:00 GMT"