I have a migration:
def change
create_table :tasks do |t|
t.date :date, :null => false
end
end
And a view:
<%= form_for @task do |f| %>
<%= f.text_field :date %>
<% end %>
The problems are
-
Why do I have “2011-12-23 00:00:00” instead of “2011-12-23” for records which are already in the database? In the database they are in the “2011-12-23” format.
-
How can internalize the dates so I could have dates like “12.23.11”.
I guess you could use the value option and the i18n API/l helper. Something like :
Then in your locale file :