Time format blocks, :long_ordinal (#6844)
May 24th, 2007
New default time format, long_ordinal.
Date.new(2005, 2, 21).to_s(:long_ordinal)
# "February 21st, 2005"
Time formats can now be given as block, for example here is the definition of :long_ordinal:
:long_ordinal => lambda do |time|
time.strftime("%B #{time.day.ordinalize}, %Y %H:%M")
end
Sorry, comments are closed for this article.