@@ -134,12 +134,13 private | |||||
134 |
|
134 | |||
135 | def graph_commits_per_month(repository) |
|
135 | def graph_commits_per_month(repository) | |
136 | @date_to = Date.today |
|
136 | @date_to = Date.today | |
137 |
@date_from = @date_to << 1 |
|
137 | @date_from = @date_to << 11 | |
|
138 | @date_from = Date.civil(@date_from.year, @date_from.month, 1) | |||
138 | commits_by_day = repository.changesets.count(:all, :group => :commit_date, :conditions => ["commit_date BETWEEN ? AND ?", @date_from, @date_to]) |
|
139 | commits_by_day = repository.changesets.count(:all, :group => :commit_date, :conditions => ["commit_date BETWEEN ? AND ?", @date_from, @date_to]) | |
139 | commits_by_month = [0] * 12 |
|
140 | commits_by_month = [0] * 12 | |
140 | commits_by_day.each {|c| commits_by_month[c.first.to_date.months_ago] += c.last } |
|
141 | commits_by_day.each {|c| commits_by_month[c.first.to_date.months_ago] += c.last } | |
141 |
|
142 | |||
142 | changes_by_day = repository.changes.count(:all, :group => :commit_date) |
|
143 | changes_by_day = repository.changes.count(:all, :group => :commit_date, :conditions => ["commit_date BETWEEN ? AND ?", @date_from, @date_to]) | |
143 | changes_by_month = [0] * 12 |
|
144 | changes_by_month = [0] * 12 | |
144 | changes_by_day.each {|c| changes_by_month[c.first.to_date.months_ago] += c.last } |
|
145 | changes_by_day.each {|c| changes_by_month[c.first.to_date.months_ago] += c.last } | |
145 |
|
146 |
General Comments 0
You need to be logged in to leave comments.
Login now