Arrange months

This commit is contained in:
Ionică Bizău 2015-02-01 16:19:03 +02:00
parent ec7a66ceda
commit 46b038394c

View file

@ -205,6 +205,7 @@ GitStats.ansiCalendar = function (data, callback) {
var year = []
, months = []
, cWeek = [" ", " ", " ", " ", " ", " ", " "]
, monthHack = "MM"
, sDay = ""
, cDayObj = null
, strYear = ""
@ -250,8 +251,8 @@ GitStats.ansiCalendar = function (data, callback) {
return DAYS[i] + c;
}).join("\n");
var foo = "MMM"
strYear = foo + months.join(" ") + "\n" + strYear;
monthHack = "MMM"
strYear = monthHack + months.join(" ") + "\n" + strYear;
strYear +=
new Array(5 + 2 * Math.ceil(365 / 7)).join("-")
+ "\n" + "Contributions in the last year: " + cal.total
@ -280,7 +281,7 @@ GitStats.ansiCalendar = function (data, callback) {
, hAlign: "left"
}).toString();
strYear = strYear.replace(foo, new Array(foo.length + 1).join(" "));
strYear = strYear.replace(monthHack, new Array(monthHack.length + 1).join(" "));
callback(null, strYear);
});