I have googled a lot on this subject but have not found an easy way to have RoR accept european date format (DD/MM/YYYY) in forms. I looked at globalize plugin but that feels heavy implementation for me because I do not need translations. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
bitterbal wrote:> I have googled a lot on this subject but have not found an easy way to > have RoR accept european date format (DD/MM/YYYY) in forms. I looked > at globalize plugin but that feels heavy implementation for me because > I do not need translations. > > > > >You can replace ParseDate.parsedate function which Rails use to parse dates. Find article with implementation on my blog: http://source.mihelac.org/articles/2006/09/13/parsing-european-date-format-in-ruby-rails best regards, Bojan -- Bojan Mihelac -> Ruby on Rails and Web Developer Blog : http://source.mihelac.org --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hello, On 6 Mar 2007, at 12:23, bitterbal wrote:> I have googled a lot on this subject but have not found an easy way to > have RoR accept european date format (DD/MM/YYYY) in forms. I looked > at globalize plugin but that feels heavy implementation for me because > I do not need translations.I''m not sure if this helps you, but you can define your own data formats in environment.rb. For example: ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!( :uk_full => ''%e %B %Y'' ) And then use the symbolic form with Date.to_s. E.g. in a view: <%= @order.created_at.to_s :uk_full %> Regards, Andy Stewart --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---