Created
September 3, 2013 08:12
-
-
Save ppworks/6420999 to your computer and use it in GitHub Desktop.
次の○曜日の日付を取りたい〜 ref: http://qiita.com/ppworks/items/001ee7f6b6de31dc8d33
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
Time.current.beginning_of_week(:friday).since(1.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
Time.parse('2013-09-02').beginning_of_week(:friday).since(1.week) | |
# => 2013-09-06 00:00:00 +0900 |
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
Time.parse('2013-09-06').beginning_of_week(:friday).since(1.week) | |
# => 2013-09-13 00:00:00 +0900 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment