Skip to content

Commit

Permalink
Merge pull request #62 from shwin0901/master
Browse files Browse the repository at this point in the history
Refix calendar heat map month overlap bug
  • Loading branch information
Folyd authored Jun 1, 2020
2 parents 6cd8a51 + 8820662 commit 7d1cd04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extension/libs/calendar-heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ function calendarHeatmap() {

var dateRange = ((d3.time && d3.time.days) || d3.timeDays)(yearAgo, now); // generates an array of date objects within the specified range
var monthRange = ((d3.time && d3.time.months) || d3.timeMonths)(moment(yearAgo).startOf('month').toDate(), now); // it ignores the first month if the 1st date is after the start of the month
monthRange = monthRange.slice(-12);
if(now.getDate() >= 23) {
monthRange = monthRange.slice(-12);
}
var firstDate = moment(dateRange[0]);
if (chart.data().length == 0) {
max = 0;
Expand Down

0 comments on commit 7d1cd04

Please sign in to comment.