From e5801338d610e1338b79a99e1be1557f35cbdf58 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 24 Jul 2015 09:47:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=80=E8=BF=91=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=9C=88=E6=97=B6=E9=97=B4=E8=B7=A8=E5=BA=A6=20?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E6=97=A5=E6=9C=9F=E5=BB=B6=E7=94=9F=E5=88=B0?= =?UTF-8?q?=E4=B8=8A=E6=9C=88=E7=9A=84=E5=BD=93=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 649f4280e..717007f54 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -628,7 +628,7 @@ update def graph_author_commits_per_month(repository) @date_to = Date.today @date_from = @date_to << 1 - @date_from = Date.civil(@date_from.year, @date_from.month, 1) + @date_from = Date.civil(@date_from.year, @date_from.month, @date_from.day) commits_by_author = Changeset.count(:all, :group => :committer, :conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to]) commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(40) @@ -664,7 +664,7 @@ update def author_commits_six_month(repository) @date_to = Date.today @date_from = @date_to << 6 - @date_from = Date.civil(@date_from.year, @date_from.month, 1) + @date_from = Date.civil(@date_from.year, @date_from.month, @date_from.day) commits_by_author = Changeset.count(:all, :group => :committer, :conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to]) commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(40)