Created
November 3, 2010 19:44
-
-
Save timmatheson/661583 to your computer and use it in GitHub Desktop.
Takes a week number and returns a range of dates occurring during the given week.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def start_and_end_dates_from_week_number(number) | |
| end_time = Time.now.at_beginning_of_year.utc + (number).weeks | |
| ((end_time-1.week)..end_time) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment