diff --git a/simple-d3-heatmap.js b/simple-d3-heatmap.js index 6f96f05..a5542e6 100644 --- a/simple-d3-heatmap.js +++ b/simple-d3-heatmap.js @@ -243,11 +243,11 @@ class SimpleD3Heatmap { // Calculate 1 week ago from the current date const oneWeekAgo = new Date(); - oneWeekAgo.setDate(oneWeekAgo.getDate() - 7); + oneWeekAgo.setDate(oneWeekAgo.getDate() - 8); // Convert the date to the format used in the data - const oneWeekAgoDay = oneWeekAgo.getUTCDay(); - const oneWeekAgoHour = oneWeekAgo.getUTCHours(); + const oneWeekAgoDay = oneWeekAgo.getDay(); + const oneWeekAgoHour = oneWeekAgo.getHours(); // add square to heatmap svg.selectAll() .data(data)