Module | ActiveSupport::CoreExtensions::Date::Conversions |
In: |
vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb
|
Getting dates in different convenient string representations and other objects
DATE_FORMATS | = | { :short => "%e %b", :long => "%B %e, %Y" |
To be able to keep Dates and Times interchangeable on conversions
# File vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb, line 22 22: def to_date 23: self 24: end
# File vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb, line 17 17: def to_formatted_s(format = :default) 18: DATE_FORMATS[format] ? strftime(DATE_FORMATS[format]).strip : to_default_s 19: end