Last active
April 20, 2016 15:08
-
-
Save scan/4d43db26af641fea7b235e5e6e4312c8 to your computer and use it in GitHub Desktop.
Get the calendar week number from a date
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
module Weeks | |
def current_week | |
Date.today.strftime('%U').to_i | |
end | |
def weeks_this_year | |
Date.today_end_of_year.strftime('%U').to_i | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment