Skip to content

Instantly share code, notes, and snippets.

@chadstachowicz
Created April 4, 2012 17:10
Show Gist options
  • Select an option

  • Save chadstachowicz/2303890 to your computer and use it in GitHub Desktop.

Select an option

Save chadstachowicz/2303890 to your computer and use it in GitHub Desktop.
time = Date.new(pyear, pmonth).to_time
monthname = Date::MONTHNAMES[time.month]
month = "%02d" % params[:month]
@gift_users = Cisco::TerminationCallDetail.initialize("1").find(:all, :conditions => ['DateTime >= ? AND DateTime <= ?', Date.new(pyear, pmonth).at_beginning_of_month, Date.new(pyear, pmonth).at_end_of_month])
Date.new(pyear, pmonth).at_beginning_of_month.upto(Date.new(pyear, pmonth).at_end_of_month).each do |date|
#totalcounts << @gift_users.select{|u| u.datetime.to_s =~ /#{date.to_s}/ }.size
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment