GitHubContributors
This commit is contained in:
@@ -67,18 +67,12 @@ namespace OurUmbraco.Community.Controllers
|
||||
|
||||
// filter to only include items from the last year
|
||||
var filteredRange = DateTime.UtcNow.AddYears(-1).Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
|
||||
var contribWeeks = contrib.Weeks.Where(x => x.W >= filteredRange);
|
||||
foreach (var contrib in gitHubContributors)
|
||||
{
|
||||
int add = 0, del = 0, total = 0;
|
||||
foreach (var wk in contrib.Weeks.Where(x => x.W >= filteredRange))
|
||||
{
|
||||
add += wk.A;
|
||||
del += wk.D;
|
||||
total += wk.C;
|
||||
}
|
||||
contrib.Total = total;
|
||||
contrib.TotalAdditions = add;
|
||||
contrib.TotalDeletions = del;
|
||||
contrib.Total = contrib.w;
|
||||
contrib.TotalAdditions = contribWeeks.Sum(x=>x.A);
|
||||
contrib.TotalDeletions = contribWeeks.Sum(x=>x.D);
|
||||
}
|
||||
|
||||
var filteredContributors = gitHubContributors
|
||||
|
||||
Reference in New Issue
Block a user