Skip to content

Instantly share code, notes, and snippets.

@mrjjwright
Created December 19, 2008 20:15
Show Gist options
  • Select an option

  • Save mrjjwright/38101 to your computer and use it in GitHub Desktop.

Select an option

Save mrjjwright/38101 to your computer and use it in GitHub Desktop.
def self.on(dateterm)
day = Chronic.parse(dateterm)
return [] if day.nil?
day = Time.zone.parse(day.to_date.to_s).utc
return Entry.find(:all, :conditions => ['created_at >= ? and created_at < ?', day, day + 86400])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment