Skip to content

Commit

Permalink
Without UTC
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedrito Colomina committed Aug 7, 2023
1 parent ed8f26c commit 12f3c45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions simple-d3-heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 12f3c45

Please sign in to comment.