I have been trying to setup an application to use uk date formats as
default. The way you used to do this was via an initialiser:

Date::DATE_FORMATS.merge!(:default => "%d/%m/%Y")
Time::DATE_FORMATS.merge!(:default => "%d/%m/%Y %H:%M")

I believe you can also alter the en.yml file to allow this as well:

en:
  date:
    formats:
      default: "%d/%m/%Y"

After doing this the console Date.today.to_s shows the date in the
correct format "27/6/2011" however I cannot get the forms to use this
format as default. The form text_fields continue to have the yyyy-mm-
dd format.

The workaround I have found is to use
f.text_field :arrival_date, :value => f.object.arrival_date.to_s but
this just seems wrong.

Any ideas?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to