<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>source.mihelac.org - Parsing european date format in Ruby/Rails Comments</title>
  <id>tag:source.mihelac.org,2008:/2006/9/13/parsing-european-date-format-in-ruby-rails/comments</id>
  <generator version="0.7.3" uri="http://mephistoblog.com">Mephisto Noh-Varr</generator>
  <link href="http://source.mihelac.org/2006/9/13/parsing-european-date-format-in-ruby-rails/comments.xml" rel="self" type="application/atom+xml"/>
  <link href="/2006/9/13/parsing-european-date-format-in-ruby-rails" rel="alternate" type="text/html"/>
  <updated>2008-09-22T10:39:42Z</updated>
  <entry xml:base="http://source.mihelac.org/">
    <author>
      <name>Greassattvab</name>
    </author>
    <id>tag:source.mihelac.org,2006-09-13:23:3648</id>
    <published>2008-09-22T10:39:42Z</published>
    <updated>2008-09-22T10:39:42Z</updated>
    <link href="http://source.mihelac.org/2006/9/13/parsing-european-date-format-in-ruby-rails" rel="alternate" type="text/html"/>
    <title>Comment on 'Parsing european date format in Ruby/Rails' by Greassattvab</title>
<content type="html">&lt;p&gt;omg.. good work, man&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://source.mihelac.org/">
    <author>
      <name>Elmer Davis</name>
    </author>
    <id>tag:source.mihelac.org,2006-09-13:23:3528</id>
    <published>2008-06-15T01:03:12Z</published>
    <updated>2008-06-15T01:03:12Z</updated>
    <link href="http://source.mihelac.org/2006/9/13/parsing-european-date-format-in-ruby-rails" rel="alternate" type="text/html"/>
    <title>Comment on 'Parsing european date format in Ruby/Rails' by Elmer Davis</title>
<content type="html">&lt;p&gt;clithridiate diversiform wricht misstater teataster nenuphar photogrammetric protropical
&lt;a href=&quot;http:&quot; /&gt;Kihei Akahi Rental Unit &lt;span class=&quot;caps&quot;&gt;D607&lt;/span&gt;&lt;/a&gt;
 http://www.wise-info.co.uk&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://source.mihelac.org/">
    <author>
      <name>anton@kopylov.net</name>
    </author>
    <id>tag:source.mihelac.org,2006-09-13:23:3483</id>
    <published>2008-04-22T17:27:43Z</published>
    <updated>2008-04-22T17:27:43Z</updated>
    <link href="http://source.mihelac.org/2006/9/13/parsing-european-date-format-in-ruby-rails" rel="alternate" type="text/html"/>
    <title>Comment on 'Parsing european date format in Ruby/Rails' by anton@kopylov.net</title>
<content type="html">&lt;p&gt;&#8220;I find much easy way: d = Date.strptime(&#8216;07.02.2008&#8217;, &#8216;%d.%m.%Y&#8217;) &#8220;&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://source.mihelac.org/">
    <author>
      <name>dimi3</name>
    </author>
    <id>tag:source.mihelac.org,2006-09-13:23:108</id>
    <published>2007-05-13T13:01:57Z</published>
    <updated>2007-05-13T13:01:57Z</updated>
    <link href="http://source.mihelac.org/2006/9/13/parsing-european-date-format-in-ruby-rails" rel="alternate" type="text/html"/>
    <title>Comment on 'Parsing european date format in Ruby/Rails' by dimi3</title>
<content type="html">It's easier to just write a method like:

def format_date(value)

  sprintf value.day.to_s + '.' + value.month.to_s + '.' + value.year.to_s

end

Or whatever you'd like.</content>  </entry>
  <entry xml:base="http://source.mihelac.org/">
    <author>
      <name>Peter</name>
    </author>
    <id>tag:source.mihelac.org,2006-09-13:23:107</id>
    <published>2007-02-16T14:22:16Z</published>
    <updated>2007-02-16T14:22:16Z</updated>
    <link href="http://source.mihelac.org/2006/9/13/parsing-european-date-format-in-ruby-rails" rel="alternate" type="text/html"/>
    <title>Comment on 'Parsing european date format in Ruby/Rails' by Peter</title>
<content type="html">As none of the strategies I found did fully satisfy me, I have now made a plugin that does format the date, selectively for specific attributes, when&lt;br /&gt;
1. pre-filling an input form (from a database entry or some default),&lt;br /&gt;
2. parsing the input form from a POST action&lt;br /&gt;
3. (optionally) presenting it in regular output&lt;br /&gt;

All one has to do is mention the respective attributes in the model, like

dt_datum_parse :date_field1, :date_field2, ...&lt;br /&gt;
dt_datum_view :date_field1, :date_field2, ...&lt;br /&gt;

It provides the &quot;german&quot; date (like &quot;28.02.2007&quot;) and works with postgresQL - which is what I need. (It does currently not support &quot;datetime&quot; fields and such.)

You're welcome to try it out, optimize, enhance it...
http://80.237.237.126/download/rails-plugins/dt_datum-1.0.tar.gz

PMc</content>  </entry>
  <entry xml:base="http://source.mihelac.org/">
    <author>
      <name>bmihelac</name>
    </author>
    <id>tag:source.mihelac.org,2006-09-13:23:106</id>
    <published>2007-02-02T08:01:10Z</published>
    <updated>2007-02-02T08:01:10Z</updated>
    <link href="http://source.mihelac.org/2006/9/13/parsing-european-date-format-in-ruby-rails" rel="alternate" type="text/html"/>
    <title>Comment on 'Parsing european date format in Ruby/Rails' by bmihelac</title>
<content type="html">Yes lib folder would be right place to put file.</content>  </entry>
  <entry xml:base="http://source.mihelac.org/">
    <author>
      <name>Mike McKay</name>
    </author>
    <id>tag:source.mihelac.org,2006-09-13:23:105</id>
    <published>2007-02-02T07:32:00Z</published>
    <updated>2007-02-02T07:32:00Z</updated>
    <link href="http://source.mihelac.org/2006/9/13/parsing-european-date-format-in-ruby-rails" rel="alternate" type="text/html"/>
    <title>Comment on 'Parsing european date format in Ruby/Rails' by Mike McKay</title>
<content type="html">Where do you save the above file? In lib?</content>  </entry>
</feed>
