# European date format input

**URL:** <https://www.ruby-forum.com/t/european-date-format-input/87856>\
**Category:** Rails\
**Created:** [March 6, 2007, 1:24pm UTC](https://www.ruby-forum.com/t/european-date-format-input/87856 "2007-03-06T13:24:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bitterbal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@bitterbal](https://www.ruby-forum.com/u/bitterbal)\
**Post date:** [March 6, 2007, 1:24pm UTC](https://www.ruby-forum.com/t/european-date-format-input/87856/1 "2007-03-06T13:24:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bitterbal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@bitterbal](https://www.ruby-forum.com/u/bitterbal)\
**Post date:** [March 6, 2007, 3:39pm UTC](https://www.ruby-forum.com/t/european-date-format-input/87856/2 "2007-03-06T15:39:15Z")

</div>

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](http://source.mihelac.org/articles/2006/09/13/parsing-european-date-format-in-ruby-rails)

## best regards, Bojan

Bojan M.  
 → Ruby on Rails and Web D. Blog : [http://source.mihelac.org](http://source.mihelac.org)

---

<div class="post-metadata">

**Author:** ![bitterbal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@bitterbal](https://www.ruby-forum.com/u/bitterbal)\
**Post date:** [March 7, 2007, 3:32pm UTC](https://www.ruby-forum.com/t/european-date-format-input/87856/3 "2007-03-07T15:32:43Z")

</div>

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:📅: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 S.
