<?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"
	>
<channel>
	<title>Comments on: How to do date, datefields, datetime like 30boxes</title>
	<atom:link href="http://scottmotte.com/archives/10/feed" rel="self" type="application/rss+xml" />
	<link>http://scottmotte.com/archives/10</link>
	<description>codes a lot</description>
	<pubDate>Fri, 05 Dec 2008 01:06:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Scott</title>
		<link>http://scottmotte.com/archives/10#comment-243</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Wed, 27 Aug 2008 07:17:53 +0000</pubDate>
		<guid isPermaLink="false">http://scottmotte.com/?p=10#comment-243</guid>
		<description>http://pastie.org/260758</description>
		<content:encoded><![CDATA[<p><a href="http://pastie.org/260758" rel="nofollow">http://pastie.org/260758</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Motte</title>
		<link>http://scottmotte.com/archives/10#comment-242</link>
		<dc:creator>Scott Motte</dc:creator>
		<pubDate>Wed, 27 Aug 2008 07:16:59 +0000</pubDate>
		<guid isPermaLink="false">http://scottmotte.com/?p=10#comment-242</guid>
		<description>require 'chronic'
class Service &#60; ActiveRecord::Base
  belongs_to :location
  belongs_to :obituary
  validates_presence_of :name
  
  def before_save
    self.start_time = Chronic.parse(self.start_time_before_type_cast) if self.start_time_before_type_cast
    self.end_time = Chronic.parse(self.end_time_before_type_cast) if self.end_time_before_type_cast
  end

  
  
  protected 
    def validate 
      errors.add(:location_id, "can't be blank") if location_id.blank?
      errors.add :start_time, 'is not a valid date. Try removing any commas.' if Chronic.parse(start_time_before_type_cast).nil?
    end
end</description>
		<content:encoded><![CDATA[<p>require &#8216;chronic&#8217;<br />
class Service &lt; ActiveRecord::Base<br />
  belongs_to :location<br />
  belongs_to :obituary<br />
  validates_presence_of :name</p>
<p>  def before_save<br />
    self.start_time = Chronic.parse(self.start_time_before_type_cast) if self.start_time_before_type_cast<br />
    self.end_time = Chronic.parse(self.end_time_before_type_cast) if self.end_time_before_type_cast<br />
  end</p>
<p>  protected<br />
    def validate<br />
      errors.add(:location_id, &#8220;can&#8217;t be blank&#8221;) if location_id.blank?<br />
      errors.add :start_time, &#8216;is not a valid date. Try removing any commas.&#8217; if Chronic.parse(start_time_before_type_cast).nil?<br />
    end<br />
end</p>
]]></content:encoded>
	</item>
</channel>
</rss>
