Rails date format in form field
Posted
by Jack
on Stack Overflow
See other posts from Stack Overflow
or by Jack
Published on 2010-03-14T17:53:07Z
Indexed on
2010/03/14
17:55 UTC
Read the original article
Hit count: 110
ruby-on-rails
|ruby
Hello
I'd like my dates in the mm/dd/year format in text fields. However, they currently displays as 2010-03-26.
Is there a global setting I can set to change this?
I tried the following, which seems to update the .to_s method, but form fields stay the same.
ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(:default => '%m/%d/%Y')
Thanks
© Stack Overflow or respective owner