Created
October 1, 2013 15:59
-
-
Save cgrusden/6780795 to your computer and use it in GitHub Desktop.
Finding date of this past Sunday & this coming up Saturday, given I'm in the middle of the current 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
sunday = (Date.today - Date.today.wday) | |
saturday = Date.today + (DateTime::DAYNAMES.index("Saturday") - Date.today.wday) | |
puts sunday.to_s | |
puts saturday.to_s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment