<?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: Rails Date Validation &#8211; Step by Step</title>
	<atom:link href="http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/feed/" rel="self" type="application/rss+xml" />
	<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/</link>
	<description>Technology, Learning, and Everything Else</description>
	<lastBuildDate>Wed, 27 May 2009 11:37:59 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Handy</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-8974</link>
		<dc:creator>Handy</dc:creator>
		<pubDate>Wed, 27 May 2009 11:37:59 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-8974</guid>
		<description>I&#039;m glad that my tutorial works well for you. :)</description>
		<content:encoded><![CDATA[<p>I&#8217;m glad that my tutorial works well for you. <img src='http://galaxyelf.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ahad L. Amdani</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-8972</link>
		<dc:creator>Ahad L. Amdani</dc:creator>
		<pubDate>Wed, 27 May 2009 06:22:04 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-8972</guid>
		<description>Hah, I resolved it by understanding that I am very new to this material and made a rookie mistake. Just needed to take the &quot;f.&quot; portion out. Thanks for this great tutorial!</description>
		<content:encoded><![CDATA[<p>Hah, I resolved it by understanding that I am very new to this material and made a rookie mistake. Just needed to take the &#8220;f.&#8221; portion out. Thanks for this great tutorial!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ahad L. Amdani</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-8971</link>
		<dc:creator>Ahad L. Amdani</dc:creator>
		<pubDate>Wed, 27 May 2009 06:19:45 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-8971</guid>
		<description>ActionView::Helpers::FormBuilder:0x2425584 with angle brackets around it (happened again)</description>
		<content:encoded><![CDATA[<p>ActionView::Helpers::FormBuilder:0&#215;2425584 with angle brackets around it (happened again)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ahad L. Amdani</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-8970</link>
		<dc:creator>Ahad L. Amdani</dc:creator>
		<pubDate>Wed, 27 May 2009 06:19:28 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-8970</guid>
		<description>the part of the error left out is due to formatting is:

undefined method `date_field’ for #</description>
		<content:encoded><![CDATA[<p>the part of the error left out is due to formatting is:</p>
<p>undefined method `date_field’ for #</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ahad L. Amdani</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-8969</link>
		<dc:creator>Ahad L. Amdani</dc:creator>
		<pubDate>Wed, 27 May 2009 06:18:01 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-8969</guid>
		<description>Handy,

I&#039;ve followed the tutorial step-by-step, and wrapped

ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(:default_date =&gt; ‘%m/%d/%Y’)

into a function into the application helper file:

module ApplicationHelper
  
  def calendar_format(date_field)
    ValidatesDateTime.us_date_format = true #use mm/dd/yyyy format
    ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS[date_field]
  end
  
end

However, trying to use the following in ../views/attorneys/edit.html.erb causes an error:
 calendar_format(@attorney.current_retroactive_date) %&gt;

The error I receive is:

undefined method `date_field&#039; for #

I don&#039;t understand it, since I have copied the included date_helper.rb file to ../app/helpers/date_helper.rb and it clearly defines the date_field:

module DateHelper
  ...
  def date_field(object_name, method, options={})
    format = options.delete(:format) &#124;&#124;
             ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS[:default] &#124;&#124;
             &#039;%d %b %Y&#039;
    if options[:value].is_a?(Date)
      options[:value] = options[:value].strftime(format)
    end
    months = Date::MONTHNAMES[1..12].collect { &#124;m&#124; &quot;&#039;#{m}&#039;&quot; }
    months = &#039;[&#039; + months.join(&#039;,&#039;) + &#039;]&#039;
    days = Date::DAYNAMES.collect { &#124;d&#124; &quot;&#039;#{d}&#039;&quot; }
    days = &#039;[&#039; + days.join(&#039;,&#039;) + &#039;]&#039;
    options = {:onfocus =&gt; &quot;this.select();calendar_open(this,{format:&#039;#{format}&#039;,images_dir:&#039;/images&#039;,month_names:#{months},day_names:#{days}})&quot;,
               :onclick =&gt; &quot;event.cancelBubble=true;this.select();calendar_open(this,{format:&#039;#{format}&#039;,images_dir:&#039;/images&#039;,month_names:#{months},day_names:#{days}})&quot;,
              }.merge(options);
    text_field object_name, method, options
  end
end

Do you have any idea why this may be the case? I have restarted my server, as I thought that may be the issue, but no such luck. I am running:

ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
Rails 2.3.2

Thanks for any assistance in advance,
  Ahad.</description>
		<content:encoded><![CDATA[<p>Handy,</p>
<p>I&#8217;ve followed the tutorial step-by-step, and wrapped</p>
<p>ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(:default_date =&gt; ‘%m/%d/%Y’)</p>
<p>into a function into the application helper file:</p>
<p>module ApplicationHelper</p>
<p>  def calendar_format(date_field)<br />
    ValidatesDateTime.us_date_format = true #use mm/dd/yyyy format<br />
    ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS[date_field]<br />
  end</p>
<p>end</p>
<p>However, trying to use the following in ../views/attorneys/edit.html.erb causes an error:<br />
 calendar_format(@attorney.current_retroactive_date) %&gt;</p>
<p>The error I receive is:</p>
<p>undefined method `date_field&#8217; for #</p>
<p>I don&#8217;t understand it, since I have copied the included date_helper.rb file to ../app/helpers/date_helper.rb and it clearly defines the date_field:</p>
<p>module DateHelper<br />
  &#8230;<br />
  def date_field(object_name, method, options={})<br />
    format = options.delete(:format) ||<br />
             ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS[:default] ||<br />
             &#8216;%d %b %Y&#8217;<br />
    if options[:value].is_a?(Date)<br />
      options[:value] = options[:value].strftime(format)<br />
    end<br />
    months = Date::MONTHNAMES[1..12].collect { |m| &#8220;&#8216;#{m}&#8217;&#8221; }<br />
    months = &#8216;[' + months.join(',') + ']&#8216;<br />
    days = Date::DAYNAMES.collect { |d| &#8220;&#8216;#{d}&#8217;&#8221; }<br />
    days = &#8216;[' + days.join(',') + ']&#8216;<br />
    options = {:onfocus =&gt; &#8220;this.select();calendar_open(this,{format:&#8217;#{format}&#8217;,images_dir:&#8217;/images&#8217;,month_names:#{months},day_names:#{days}})&#8221;,<br />
               <img src='http://galaxyelf.com/blog/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nclick =&gt; &#8220;event.cancelBubble=true;this.select();calendar_open(this,{format:&#8217;#{format}&#8217;,images_dir:&#8217;/images&#8217;,month_names:#{months},day_names:#{days}})&#8221;,<br />
              }.merge(options);<br />
    text_field object_name, method, options<br />
  end<br />
end</p>
<p>Do you have any idea why this may be the case? I have restarted my server, as I thought that may be the issue, but no such luck. I am running:</p>
<p>ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]<br />
Rails 2.3.2</p>
<p>Thanks for any assistance in advance,<br />
  Ahad.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flo</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-8646</link>
		<dc:creator>Flo</dc:creator>
		<pubDate>Wed, 18 Mar 2009 09:46:05 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-8646</guid>
		<description>Nice work ! and nice doc !
I&#039;ve followed the step-by-step doc and everything went fine !</description>
		<content:encoded><![CDATA[<p>Nice work ! and nice doc !<br />
I&#8217;ve followed the step-by-step doc and everything went fine !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doc Pneumo</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-8470</link>
		<dc:creator>Doc Pneumo</dc:creator>
		<pubDate>Wed, 11 Feb 2009 16:16:17 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-8470</guid>
		<description>validates_timeliness seems to work well on the first pass. 

At the moment I&#039;m developing in a Windows environment. Loading the plugin had lots of problems. However, doing &#039;gem install validates_timeliness&#039; worked fine.  The current version is 1.1.5 .
Remember to put this in config/environment:   config.gem &quot;validates_timeliness&quot;

Doc Pneumo</description>
		<content:encoded><![CDATA[<p>validates_timeliness seems to work well on the first pass. </p>
<p>At the moment I&#8217;m developing in a Windows environment. Loading the plugin had lots of problems. However, doing &#8216;gem install validates_timeliness&#8217; worked fine.  The current version is 1.1.5 .<br />
Remember to put this in config/environment:   config.gem &#8220;validates_timeliness&#8221;</p>
<p>Doc Pneumo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doc Pneumo</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-8468</link>
		<dc:creator>Doc Pneumo</dc:creator>
		<pubDate>Tue, 10 Feb 2009 23:16:05 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-8468</guid>
		<description>Handy,

After submitting my last post, I found the validates_timeliness plugin at git://github.com/adzap/validates_timeliness.git. This appears to answer my concerns and more. I&#039;ve skimmed the code but haven&#039;t used it yet. Will swap it in for validates_date_time in a project I&#039;m working on. Will report any issues I find.

Doc Pneumo</description>
		<content:encoded><![CDATA[<p>Handy,</p>
<p>After submitting my last post, I found the validates_timeliness plugin at git://github.com/adzap/validates_timeliness.git. This appears to answer my concerns and more. I&#8217;ve skimmed the code but haven&#8217;t used it yet. Will swap it in for validates_date_time in a project I&#8217;m working on. Will report any issues I find.</p>
<p>Doc Pneumo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doc Pneumo</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-8467</link>
		<dc:creator>Doc Pneumo</dc:creator>
		<pubDate>Tue, 10 Feb 2009 18:00:54 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-8467</guid>
		<description>Handi,

Using Rails 2.2.0 Other versions were not tried.

Validates_date_time has some behaviors that are problematic. It does not appear possible to allow validation of a date_time field to distinguish between a nil entry and an entry that Rails rejects by substituting a nil for that value. For example setting :allow_nil =&gt; true causes both &quot;record.field = nil&quot; and &quot;record.field = &#039;a funny date&#039;&quot; to pass validation. :allow_nil =&gt; false ,the default, rejects both entries. However, a field for which an optional entry must be validated is not handled by validates_date_time.

I think the problem is that if time zone conversion is in effect, Rails checks in ActiveRecord::AttributeMethods for a valid date_time before storing the raw_value in @attributes. &quot;#{attr_name}_before_type_cast&quot; is a misnomer. It returns @attributes[attr_name]. But date or time fields stored in @attributes have already been parsed into an appropriate format or replaced with nil. This prevents validates_date_time from doing its own validation and issuing an appropriate error message. If the DB is set up to allow nil for that field then no complaint will ever be issued.  A near miss date would be accepted and stored as nil without warning! The only validations that can be done are that a date is sane from the validation perspective or that a nil will be stored in the database on save or update. Validation cannot check for an unsupplied date or time versus an invalid string.

You can see the behavior of Rails by making the following change in the validates_date_time code:

    def validates_date(*args)
      ...
      validates_each(attr_names, options) do &#124;record, attr_name, value&#124;
        raw_value = record.send(&quot;#{attr_name}_before_type_cast&quot;)
        
        rv = raw_value.nil ? &#039;nil&#039; : raw_value
        puts &quot;Attr Name: #{attr_name}, Value: #{value}, Raw Value: #{rv}&quot; 
    #   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
        if (!raw_value.blank? and !value) &#124;&#124; (raw_value.blank? and !allow_nil)
      ...
    end

Run some unit tests against a model with validates_date_time properly installed and with the following in place:

	validates_date :start, :allow_nil =&gt; true
	
Validating a record with start set to &#039;a funny date&#039; will pass. This will appear in the test run: 

	Attr Name: start, Value: a funny date, Raw Value: nil
	
Inspection of the record after the assignment will show:

	... start: nil, ...


Assuming that time zone conversion is desirable, I do not know how to get around this except by changing the Rails behavior, itself. For example one could add a @raw_date_time hash to the model and store the unparsed value for the attribute as @raw_date_time[attr_name]. Then validate_date_time could access @raw_date_time with a getter for the raw_value rather than using &quot;#{attr_name}_before_type_cast&quot;. the relevant code is in attribute_methods.rb of the Rails code:
	
    def define_write_method_for_time_zone_conversion(attr_name)
      method_body = &lt;&lt;-EOV
        def #{attr_name}=(time)
          @raw_date_time[#{attr_name}] = time  #&lt;&lt;&lt;&lt;&lt; Added code.
                                               #      @raw_date_time must have been defined
                                               #      for the instance, of course.
          unless time.acts_like?(:time)
            time = time.is_a?(String) ? Time.zone.parse(time) : time.to_time rescue time
          end
          time = time.in_time_zone rescue nil if time
          write_attribute(:#{attr_name}, time)
        end
      EOV
      evaluate_attribute_method attr_name, method_body, &quot;#{attr_name}=&quot;
    end

Any thoughts on this? It seems date &amp; time validation is still a problem! I would love to find a good solution or to be proven wrong.

BTW. The methods for validates_date, validates_time, and validates_date_time share a lot of code. A good place to DRY the code base. ;)

Doc Pneumo</description>
		<content:encoded><![CDATA[<p>Handi,</p>
<p>Using Rails 2.2.0 Other versions were not tried.</p>
<p>Validates_date_time has some behaviors that are problematic. It does not appear possible to allow validation of a date_time field to distinguish between a nil entry and an entry that Rails rejects by substituting a nil for that value. For example setting :allow_nil =&gt; true causes both &#8220;record.field = nil&#8221; and &#8220;record.field = &#8216;a funny date&#8217;&#8221; to pass validation. :allow_nil =&gt; false ,the default, rejects both entries. However, a field for which an optional entry must be validated is not handled by validates_date_time.</p>
<p>I think the problem is that if time zone conversion is in effect, Rails checks in ActiveRecord::AttributeMethods for a valid date_time before storing the raw_value in @attributes. &#8220;#{attr_name}_before_type_cast&#8221; is a misnomer. It returns @attributes[attr_name]. But date or time fields stored in @attributes have already been parsed into an appropriate format or replaced with nil. This prevents validates_date_time from doing its own validation and issuing an appropriate error message. If the DB is set up to allow nil for that field then no complaint will ever be issued.  A near miss date would be accepted and stored as nil without warning! The only validations that can be done are that a date is sane from the validation perspective or that a nil will be stored in the database on save or update. Validation cannot check for an unsupplied date or time versus an invalid string.</p>
<p>You can see the behavior of Rails by making the following change in the validates_date_time code:</p>
<p>    def validates_date(*args)<br />
      &#8230;<br />
      validates_each(attr_names, options) do |record, attr_name, value|<br />
        raw_value = record.send(&#8221;#{attr_name}_before_type_cast&#8221;)</p>
<p>        rv = raw_value.nil ? &#8216;nil&#8217; : raw_value<br />
        puts &#8220;Attr Name: #{attr_name}, Value: #{value}, Raw Value: #{rv}&#8221;<br />
    #   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</p>
<p>        if (!raw_value.blank? and !value) || (raw_value.blank? and !allow_nil)<br />
      &#8230;<br />
    end</p>
<p>Run some unit tests against a model with validates_date_time properly installed and with the following in place:</p>
<p>	validates_date :start, :allow_nil =&gt; true</p>
<p>Validating a record with start set to &#8216;a funny date&#8217; will pass. This will appear in the test run: </p>
<p>	Attr Name: start, Value: a funny date, Raw Value: nil</p>
<p>Inspection of the record after the assignment will show:</p>
<p>	&#8230; start: nil, &#8230;</p>
<p>Assuming that time zone conversion is desirable, I do not know how to get around this except by changing the Rails behavior, itself. For example one could add a @raw_date_time hash to the model and store the unparsed value for the attribute as @raw_date_time[attr_name]. Then validate_date_time could access @raw_date_time with a getter for the raw_value rather than using &#8220;#{attr_name}_before_type_cast&#8221;. the relevant code is in attribute_methods.rb of the Rails code:</p>
<p>    def define_write_method_for_time_zone_conversion(attr_name)<br />
      method_body = &lt;&lt;-EOV<br />
        def #{attr_name}=(time)<br />
          @raw_date_time[#{attr_name}] = time  #&lt;&lt;&lt;&lt;&lt; Added code.<br />
                                               #      @raw_date_time must have been defined<br />
                                               #      for the instance, of course.<br />
          unless time.acts_like?(:time)<br />
            time = time.is_a?(String) ? Time.zone.parse(time) : time.to_time rescue time<br />
          end<br />
          time = time.in_time_zone rescue nil if time<br />
          write_attribute(:#{attr_name}, time)<br />
        end<br />
      EOV<br />
      evaluate_attribute_method attr_name, method_body, &#8220;#{attr_name}=&#8221;<br />
    end</p>
<p>Any thoughts on this? It seems date &amp; time validation is still a problem! I would love to find a good solution or to be proven wrong.</p>
<p>BTW. The methods for validates_date, validates_time, and validates_date_time share a lot of code. A good place to DRY the code base. <img src='http://galaxyelf.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Doc Pneumo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Handy</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-6049</link>
		<dc:creator>Handy</dc:creator>
		<pubDate>Sat, 09 Aug 2008 16:20:23 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-6049</guid>
		<description>Colin,

I can still delete a valid date from my form.

A couple things to check:
- The field value should be empty when the user saves the form. Can you verify that the controller correctly get an empty string from the field?
- Are you sure the date is not protected field?

Handy</description>
		<content:encoded><![CDATA[<p>Colin,</p>
<p>I can still delete a valid date from my form.</p>
<p>A couple things to check:<br />
- The field value should be empty when the user saves the form. Can you verify that the controller correctly get an empty string from the field?<br />
- Are you sure the date is not protected field?</p>
<p>Handy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Stevens</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-6047</link>
		<dc:creator>Colin Stevens</dc:creator>
		<pubDate>Fri, 08 Aug 2008 04:26:11 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-6047</guid>
		<description>Hi Handy,

One problem i&#039;ve come across is that it seems impossible to change a date to nil from a valid date once it is set - any ideas ?</description>
		<content:encoded><![CDATA[<p>Hi Handy,</p>
<p>One problem i&#8217;ve come across is that it seems impossible to change a date to nil from a valid date once it is set &#8211; any ideas ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Handy</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-5829</link>
		<dc:creator>Handy</dc:creator>
		<pubDate>Mon, 21 Jul 2008 02:37:09 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-5829</guid>
		<description>Cheri,

Interesting idea... I&#039;ve never thought about doing the embedded calendar since I think the form looks more clean for my project. Different projects have different requirements, correct? :)

The date field is calling calendar_open from public/javascripts/calendar.js.
To show the calendar, you may try to call calendar_open with the same parameters on a hidden date field. When the user clicks on the date, the calendar should update the hidden field, which can be submitted when the user accepts the form.

Let me know if this works and I&#039;ll be happy to put a link to your investigation.

Handy</description>
		<content:encoded><![CDATA[<p>Cheri,</p>
<p>Interesting idea&#8230; I&#8217;ve never thought about doing the embedded calendar since I think the form looks more clean for my project. Different projects have different requirements, correct? <img src='http://galaxyelf.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The date field is calling calendar_open from public/javascripts/calendar.js.<br />
To show the calendar, you may try to call calendar_open with the same parameters on a hidden date field. When the user clicks on the date, the calendar should update the hidden field, which can be submitted when the user accepts the form.</p>
<p>Let me know if this works and I&#8217;ll be happy to put a link to your investigation.</p>
<p>Handy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cheri A</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-5817</link>
		<dc:creator>Cheri A</dc:creator>
		<pubDate>Sun, 20 Jul 2008 03:29:46 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-5817</guid>
		<description>Ok, the ruby code did not go through on my previous post.  
I want to embed the calendar in a Rails form using
&quot;form_for @posting do &#124;f&#124;&quot;?

Thanks,
Cheri</description>
		<content:encoded><![CDATA[<p>Ok, the ruby code did not go through on my previous post.<br />
I want to embed the calendar in a Rails form using<br />
&#8220;form_for @posting do |f|&#8221;?</p>
<p>Thanks,<br />
Cheri</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Handy</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-5605</link>
		<dc:creator>Handy</dc:creator>
		<pubDate>Tue, 24 Jun 2008 00:09:25 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-5605</guid>
		<description>John,

This post is used mainly for en-us locale. If you use a different locale, you&#039;re correct that ValidatesDateTime.us_date_format = false.

Also, don&#039;t forget to change step 5:
ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(:default_date =&gt; ‘%m/%d/%Y’)

The default date format for display should be changed as well.

Let me know if you have other question.

Handy</description>
		<content:encoded><![CDATA[<p>John,</p>
<p>This post is used mainly for en-us locale. If you use a different locale, you&#8217;re correct that ValidatesDateTime.us_date_format = false.</p>
<p>Also, don&#8217;t forget to change step 5:<br />
ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(:default_date => ‘%m/%d/%Y’)</p>
<p>The default date format for display should be changed as well.</p>
<p>Let me know if you have other question.</p>
<p>Handy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John McAuley</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-5604</link>
		<dc:creator>John McAuley</dc:creator>
		<pubDate>Mon, 23 Jun 2008 15:40:21 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-5604</guid>
		<description>Handy,

I got all nulls untill I did the following:

ValidatesDateTime.us_date_format = false #use mm/dd/yyyy format

Hey Presto, it worked.

Laters,
j</description>
		<content:encoded><![CDATA[<p>Handy,</p>
<p>I got all nulls untill I did the following:</p>
<p>ValidatesDateTime.us_date_format = false #use mm/dd/yyyy format</p>
<p>Hey Presto, it worked.</p>
<p>Laters,<br />
j</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John McAuley</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-5603</link>
		<dc:creator>John McAuley</dc:creator>
		<pubDate>Mon, 23 Jun 2008 14:51:24 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-5603</guid>
		<description>Hi Handy,

I installed the plugin as a above, instead of downloading it, and the error has disappeared but there are only nulls being writted to the database. Any ideas?

j</description>
		<content:encoded><![CDATA[<p>Hi Handy,</p>
<p>I installed the plugin as a above, instead of downloading it, and the error has disappeared but there are only nulls being writted to the database. Any ideas?</p>
<p>j</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John McAuley</title>
		<link>http://galaxyelf.com/blog/2008/05/26/rails-date-validation-step-by-step/comment-page-1/#comment-5602</link>
		<dc:creator>John McAuley</dc:creator>
		<pubDate>Mon, 23 Jun 2008 14:46:51 +0000</pubDate>
		<guid isPermaLink="false">http://galaxyelf.com/blog/?p=55#comment-5602</guid>
		<description>Hi Handy,

Thanks for the great tutorial.  It is really very usefull, however I am getting one error on your implementation.   Whne I place ValidatesDateTime.us_date_format = true #use mm/dd/yyyy format in my model I receive the following error:

uninitialized constant Visit::ValidatesDateTime

Have you any ideas, I&#039;m pulling out my hair!

Thanks again.

j</description>
		<content:encoded><![CDATA[<p>Hi Handy,</p>
<p>Thanks for the great tutorial.  It is really very usefull, however I am getting one error on your implementation.   Whne I place ValidatesDateTime.us_date_format = true #use mm/dd/yyyy format in my model I receive the following error:</p>
<p>uninitialized constant Visit::ValidatesDateTime</p>
<p>Have you any ideas, I&#8217;m pulling out my hair!</p>
<p>Thanks again.</p>
<p>j</p>
]]></content:encoded>
	</item>
</channel>
</rss>
