search for: date_sql_str

Displaying 1 result from an estimated 1 matches for "date_sql_str".

2006 Apr 22
1
Gruff
...# Send a graph to the browser def crumpetchartaction days = 5 g = Gruff::Line.new(500) g.title = "Crumpets over the past #{days} days" g.theme_keynote crumpets_to_date = [] labels = {} days.downto(0) do |day| date_stamp = Time.now - (60*60*24*day) date_sql_string = date_stamp.strftime("%Y-%m-%d") crumpets_to_date << Crumpets.count("created_on < ''#{date_sql_string}''").to_i labels[days-day] = date_stamp.strftime("%b %d") if day % 3 == 0 end g.data("Crumpets Sold", crum...