Skip to content

Commit

Permalink
doc: date/conversions.rb should talk about date format not time format.
Browse files Browse the repository at this point in the history
Closes #13245.

[ci skip]
  • Loading branch information
senny committed Dec 10, 2013
1 parent 7cf9a43 commit 900191f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activesupport/lib/active_support/core_ext/date/conversions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ class Date
# date.to_formatted_s(:rfc822) # => "10 Nov 2007"
# date.to_formatted_s(:iso8601) # => "2007-11-10"
#
# == Adding your own time formats to to_formatted_s
# == Adding your own date formats to to_formatted_s
# You can add your own formats to the Date::DATE_FORMATS hash.
# Use the format name as the hash key and either a strftime string
# or Proc instance that takes a date argument as the value.
#
# # config/initializers/time_formats.rb
# # config/initializers/date_formats.rb
# Date::DATE_FORMATS[:month_and_year] = '%B %Y'
# Date::DATE_FORMATS[:short_ordinal] = ->(date) { date.strftime("%B #{date.day.ordinalize}") }
def to_formatted_s(format = :default)
Expand Down

0 comments on commit 900191f

Please sign in to comment.