Skip to content

Instantly share code, notes, and snippets.

@ppworks
Created September 3, 2013 08:12
Show Gist options
  • Save ppworks/6420999 to your computer and use it in GitHub Desktop.
Save ppworks/6420999 to your computer and use it in GitHub Desktop.
次の○曜日の日付を取りたい〜 ref: http://qiita.com/ppworks/items/001ee7f6b6de31dc8d33
Time.current.beginning_of_week(:friday).since(1.week)
Time.parse('2013-09-02').beginning_of_week(:friday).since(1.week)
# => 2013-09-06 00:00:00 +0900
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