instance method
end_of_month
Ruby on Rails 7.1.6
Since v4.0.13Signature
end_of_month()
Returns a new date/time representing the end of the month. DateTime objects will have a time set to 23:59:59.
Source
# File activesupport/lib/active_support/core_ext/date_and_time/calculations.rb, line 296
def end_of_month
last_day = ::Time.days_in_month(month, year)
last_hour(days_since(last_day - day))
end
Defined in activesupport/lib/active_support/core_ext/date_and_time/calculations.rb line 296
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in DateAndTime::Calculations