I am trying to setup an application so that the dates when displayed
default to english format ie "dd/mm/yyyy"
In rails 2 you used to do it via an initializer:
Date::DATE_FORMATS.merge!(:default => "%d/%m/%Y")
Time::DATE_FORMATS.merge!(:default => "%d/%m/%Y")
In rails 3 I believe you do it via the en.yml file and set something
like :
en:
date:
formats:
default: "%d/%m/%Y"
I have tried both methods with rails 3.1 and although the console
seems to work
Date.today.to_s => "27/06/2011"
and the locale is showing correctly
I18n.t "date.formats.default" => "%d/%m/%Y"
the form continues to display the date fields as "YYYY-MM-DD".
I could translate each field in turn but this makes a mockery of the
default formats.
Any ideas?
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.