instance method end_of_week

Ruby on Rails 2.2.3

Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

end_of_week()

Returns a new Time representing the end of this week (Sunday, 23:59:59)

Source
# File activesupport/lib/active_support/core_ext/time/calculations.rb, line 190
        def end_of_week
          days_to_sunday = self.wday!=0 ? 7-self.wday : 0
          (self + days_to_sunday.days).end_of_day
        end

Defined in activesupport/lib/active_support/core_ext/time/calculations.rb line 190 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::CoreExtensions::Time::Calculations

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close