From ea7a525e53230c1de27c14b5ace0945914d2087b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionic=C4=83=20Biz=C4=83u?= Date: Mon, 9 Feb 2015 11:51:48 +0200 Subject: [PATCH] Clone data --- lib/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 466ec72..b9688da 100644 --- a/lib/index.js +++ b/lib/index.js @@ -276,11 +276,15 @@ GitStats.ansiCalendar = function (data, callback) { , strYear = "" , w = 0 , d = 0 + , dataClone = { + start: data.start ? Moment(data.start.format(DATE_FORMAT), DATE_FORMAT) : null + , end: data.end ? Moment(data.end.format(DATE_FORMAT), DATE_FORMAT) : null + } ; GitStats.calendar(data, function (err, cal) { if (err) { return callback(err); } - GitStats.iterateDays(function (cDay, mDay) { + GitStats.iterateDays(dataClone, function (cDay, mDay) { sDay = mDay.format("ddd"); if (mDay.format("D") === "1") { months.push(mDay.format("MMM"));