Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save mrjjwright/38100 to your computer and use it in GitHub Desktop.
def self.on(dateterm)
day = Time.zone.parse(Chronic.parse(dateterm).to_date.to_s)
return [] if day.nil?
day = day.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