mirror of
https://github.com/IonicaBizau/git-stats.git
synced 2024-12-22 13:22:11 +01:00
The magic. Stringify the year.
This commit is contained in:
parent
78082da8c8
commit
f7067007b8
1 changed files with 14 additions and 2 deletions
16
lib/index.js
16
lib/index.js
|
@ -179,9 +179,12 @@ GitStats.ansiCalendar = function (data, callback) {
|
|||
}
|
||||
|
||||
var year = []
|
||||
, cWeek = []
|
||||
, cWeek = [" ", " ", " ", " ", " ", " ", " "]
|
||||
, sDay = ""
|
||||
, cDayObj = null
|
||||
, strYear = ""
|
||||
, w = 0
|
||||
, d = 0
|
||||
;
|
||||
|
||||
|
||||
|
@ -193,7 +196,7 @@ GitStats.ansiCalendar = function (data, callback) {
|
|||
|
||||
if (sDay === "Sun" && Object.keys(cWeek).length) {
|
||||
year.push(cWeek);
|
||||
cWeek = []
|
||||
cWeek = [" ", " ", " ", " ", " ", " ", " "];
|
||||
}
|
||||
|
||||
if (!cDayObj) return;
|
||||
|
@ -205,6 +208,15 @@ GitStats.ansiCalendar = function (data, callback) {
|
|||
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);
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue