I have a list of tasks (name, starts_at), and I'm trying to display them in daily mode (like iCal).
def todays_tasks(day)
Task.find(:all, :conditions => ["starts_at between ? and ?", day.beginning, day.ending]
end
I can’t understand how to convert Time.now, for example, "2009-04-12 10:00:00", to the beginning (and end) of the day dynamically so that I can make a comparison.
source
share