Changeset 82832
- Timestamp:
- 08/20/11 18:30:43 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gsoc11-statistics/stats-server/app/controllers/ports_controller.rb
r82157 r82832 18 18 def populate_monthly_versions(chart_name, chart) 19 19 chart.string "Month" 20 20 21 21 # Add version columns 22 22 column_order = [] … … 82 82 now = Time.now 83 83 now_d = now.to_date 84 month_range = (0..11)85 86 for i in month_range84 85 # Iterate over months from 11 months ago to 0 months ago (current month) 86 11.downto(0) do |i| 87 87 month = now.months_ago(i).to_date 88 88 … … 104 104 end 105 105 106 key = month.at_beginning_of_month.to_s 106 # Key is the abbreviated month name and the year (eg: Aug 2011) 107 key = month.to_time.strftime("%b %Y") 107 108 monthly_installs[key] = entries.size 108 109 end … … 114 115 version_entries = entries.where("version = ?", version) 115 116 116 key = month.at_beginning_of_month.to_s 117 # Key is the abbreviated month name and the year (eg: Aug 2011) 118 key = month.to_time.strftime("%b %Y") 117 119 118 120 if monthly_versions[key].nil?
Note: See TracChangeset
for help on using the changeset viewer.

