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