The magic. Stringify the year.

This commit is contained in:
Ionică Bizău 2015-01-27 13:13:59 +02:00
parent 78082da8c8
commit f7067007b8

View file

@ -179,9 +179,12 @@ GitStats.ansiCalendar = function (data, callback) {
} }
var year = [] var year = []
, cWeek = [] , cWeek = [" ", " ", " ", " ", " ", " ", " "]
, sDay = "" , sDay = ""
, cDayObj = null , cDayObj = null
, strYear = ""
, w = 0
, d = 0
; ;
@ -193,7 +196,7 @@ GitStats.ansiCalendar = function (data, callback) {
if (sDay === "Sun" && Object.keys(cWeek).length) { if (sDay === "Sun" && Object.keys(cWeek).length) {
year.push(cWeek); year.push(cWeek);
cWeek = [] cWeek = [" ", " ", " ", " ", " ", " ", " "];
} }
if (!cDayObj) return; if (!cDayObj) return;
@ -205,6 +208,15 @@ GitStats.ansiCalendar = function (data, callback) {
year.push(cWeek); year.push(cWeek);
} }
for (d = 0; d < 7; ++d) {
for (w = 0; w < year.length; ++w) {
strYear += " " + year[w][d];
}
strYear += "\n";
}
callback(null, strYear);
}); });
}; };