0.0
No commit activity in last 3 years
No release in over 3 years
Calculate dates based on a configurable first day of the week. If you want the first day of the week to be Wednesday and the current calendar Year-Month are 2009-10, DateTime#week_days will return an array of DateTime objects which when formatted with "%Y-%m-%d %a" look like ["2009-10-14 Wed", "2009-10-15 Thu", "2009-10-16 Fri", "2009-10-17 Sat", "2009-10-18 Sun", "2009-10-19 Mon", "2009-10-20 Tue"]
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

shifty_week¶ ↑

Description in ShiftyWeek

Quick Intro¶ ↑

n = DateTime.now n.week_day_start = ‘Wednesday’ n.week_days # => [2009-11-04T00:16:27-08:00, 2009-11-05T00:16:27-08:00, 2009-11-06T00:16:27-08:00, 2009-11-07T00:16:27-08:00, 2009-11-08T00:16:27-08:00, 2009-11-09T00:16:27-08:00, 2009-11-10T00:16:27-08:00]

Installation¶ ↑

  1. Require the gem

  2. Require the libs:

    shifty_week shifty_week/time shifty_week/date

Note on Patches/Pull Requests¶ ↑

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but

    bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

Copyright © 2009 Scott Noel-Hemming. See LICENSE for details.