<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Custom Date Formats for Your Rails Application</title>
	<atom:link href="http://seanbehan.com/ruby-on-rails/custom-date-formats-for-your-rails-application/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanbehan.com/ruby-on-rails/custom-date-formats-for-your-rails-application/</link>
	<description>Web Programming, Ruby on Rails, Wordpress, PHP from Burlington, Vermont</description>
	<lastBuildDate>Wed, 16 May 2012 14:49:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Steven Noble</title>
		<link>http://seanbehan.com/ruby-on-rails/custom-date-formats-for-your-rails-application/#comment-22</link>
		<dc:creator>Steven Noble</dc:creator>
		<pubDate>Fri, 10 Jul 2009 08:34:58 +0000</pubDate>
		<guid isPermaLink="false">http://bseanvt.wordpress.com/?p=230#comment-22</guid>
		<description>Love your work. Got it in one.</description>
		<content:encoded><![CDATA[<p>Love your work. Got it in one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://seanbehan.com/ruby-on-rails/custom-date-formats-for-your-rails-application/#comment-21</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Thu, 09 Jul 2009 17:03:11 +0000</pubDate>
		<guid isPermaLink="false">http://bseanvt.wordpress.com/?p=230#comment-21</guid>
		<description>Yeah, You have the wrong method order converting AM/PM to lowercase.

You have in your code
&lt;pre&gt;
date.strftime.downcase(”%p”)
&lt;/pre&gt;
But you need
&lt;pre&gt;
date.strftime(&quot;%p&quot;).downcase
&lt;/pre&gt;
You&#039;re getting an argument error because of this.</description>
		<content:encoded><![CDATA[<p>Yeah, You have the wrong method order converting AM/PM to lowercase.</p>
<p>You have in your code</p>
<pre class="wp-code-highlight prettyprint">
date.strftime.downcase(”%p”)
</pre>
<p>But you need</p>
<pre class="wp-code-highlight prettyprint">
date.strftime(&quot;%p&quot;).downcase
</pre>
<p>You&#8217;re getting an argument error because of this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Noble</title>
		<link>http://seanbehan.com/ruby-on-rails/custom-date-formats-for-your-rails-application/#comment-20</link>
		<dc:creator>Steven Noble</dc:creator>
		<pubDate>Thu, 09 Jul 2009 10:25:05 +0000</pubDate>
		<guid isPermaLink="false">http://bseanvt.wordpress.com/?p=230#comment-20</guid>
		<description>Cheers for this.

I have the following in /config/initializers/time_formats.rb:

ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(
:sentence =&gt; lambda { &#124;date&#124; date.strftime(&quot;%B #{date.day.ordinalize}, %Y, at %l.%M&quot;) + date.strftime.downcase(&quot;%p&quot;) }
)

I have the following in a view:



I get this error when I load the view in a browser:

wrong number of arguments (0 for 1)

I get no error (but no formatting) if I instead use this in the view:



Any idea what&#039;s going on?</description>
		<content:encoded><![CDATA[<p>Cheers for this.</p>
<p>I have the following in /config/initializers/time_formats.rb:</p>
<p>ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(<br />
:sentence =&gt; lambda { |date| date.strftime(&#8220;%B #{date.day.ordinalize}, %Y, at %l.%M&#8221;) + date.strftime.downcase(&#8220;%p&#8221;) }<br />
)</p>
<p>I have the following in a view:</p>
<p>I get this error when I load the view in a browser:</p>
<p>wrong number of arguments (0 for 1)</p>
<p>I get no error (but no formatting) if I instead use this in the view:</p>
<p>Any idea what&#8217;s going on?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bseanvt</title>
		<link>http://seanbehan.com/ruby-on-rails/custom-date-formats-for-your-rails-application/#comment-19</link>
		<dc:creator>bseanvt</dc:creator>
		<pubDate>Thu, 14 May 2009 15:33:55 +0000</pubDate>
		<guid isPermaLink="false">http://bseanvt.wordpress.com/?p=230#comment-19</guid>
		<description>Thanks! I was using a datetime type field from the db (created_at/updated_at) so I needed to add it to the Time module instead.

ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(
  :simple =&gt; &quot;%A %B %d, %Y&quot;
)</description>
		<content:encoded><![CDATA[<p>Thanks! I was using a datetime type field from the db (created_at/updated_at) so I needed to add it to the Time module instead.</p>
<p>ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(<br />
  :simple =&gt; &#8220;%A %B %d, %Y&#8221;<br />
)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Moreno</title>
		<link>http://seanbehan.com/ruby-on-rails/custom-date-formats-for-your-rails-application/#comment-18</link>
		<dc:creator>Greg Moreno</dc:creator>
		<pubDate>Thu, 14 May 2009 05:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://bseanvt.wordpress.com/?p=230#comment-18</guid>
		<description>Or you can store the format a file config/initializers/date_formats.rb  with the ff code:

ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(
  :my_custom_format =&gt; &quot;%A %B %d, %Y&quot;
)</description>
		<content:encoded><![CDATA[<p>Or you can store the format a file config/initializers/date_formats.rb  with the ff code:</p>
<p>ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(<br />
  :my_custom_format =&gt; &#8220;%A %B %d, %Y&#8221;<br />
)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

