Skip to content

Commit 087a393

Browse files
committed
Code style
1 parent f23ac9a commit 087a393

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/index.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,16 @@ GitStats.ansiCalendar = function (data, callback) {
342342

343343
// Months label
344344
monthHack = "MMMM"; //Left padding
345-
for (var i=0; i<months.length; i++) {
346-
// The length of strMonths should always be 2*(i+1) (at the i-th column)
347-
if (months[i] === undefined) strMonths += new Array(2*(i+1)-strMonths.length+1).join(" ");
348-
else strMonths += months[i];
345+
346+
for (var i = 0; i < months.length; i++) {
347+
// The length of strMonths should always be 2*(i+1) (at the i-th column)
348+
if (!months[i]) {
349+
strMonths += new Array(2*(i+1)-strMonths.length+1).join(" ");
350+
} else {
351+
strMonths += months[i];
352+
}
349353
}
354+
350355
strYear = monthHack + strMonths + "\n" + strYear;
351356
strYear +=
352357
new Array(5 + 2 * Math.ceil(365 / 7)).join("-")

0 commit comments

Comments
 (0)