Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 37 additions & 24 deletions site-before-rework-June2015/js/commits.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,40 @@
function buildCommits()
{
var allCommits = [];
var timelines = [];
for ( var i = 0; i < reposTab.length; ++i )
{
var thisRepo = reposTab[i].repo;
var thisCommits = reposTab[i].commits;
for ( var j = 0; j < thisCommits.length; ++j )
{
var thisCommit = thisCommits[j];
thisCommit.repo = thisRepo.name;
thisCommit.authorDate = d3.time.format.iso.parse(thisCommit.authorDate);
thisCommit.commitDate = d3.time.format.iso.parse(thisCommit.commitDate);
}
var timeline = {
repo: thisRepo.name,
earliest: thisCommits[thisCommits.length - 1].commitDate,
latest: thisCommits[0].commitDate
};
allCommits.push.apply(allCommits, thisCommits);
timelines.push(timeline);
}
drawChart(allCommits, timelines);
function buildCommits() {
if (!reposTab || !Array.isArray(reposTab)) {
console.error("reposTab is undefined or not an array.");
return;
}

const allCommits = [];
const timelines = [];
const parseDate = d3.timeParse("%Y-%m-%dT%H:%M:%S.%LZ"); // Adjust format as needed

for (let i = 0; i < reposTab.length; ++i) {
const thisRepo = reposTab[i].repo;
const thisCommits = reposTab[i].commits;

if (!thisCommits || thisCommits.length === 0) {
console.warn(`No commits found for repo: ${thisRepo.name}`);
continue;
}

for (let j = 0; j < thisCommits.length; ++j) {
const thisCommit = thisCommits[j];
thisCommit.repo = thisRepo.name;
thisCommit.authorDate = parseDate(thisCommit.authorDate);
thisCommit.commitDate = parseDate(thisCommit.commitDate);
}

const timeline = {
repo: thisRepo.name,
earliest: thisCommits[thisCommits.length - 1].commitDate,
latest: thisCommits[0].commitDate
};

allCommits.push(...thisCommits);
timelines.push(timeline);
}

drawChart(allCommits, timelines);
}

buildCommits();