Skip to content

Commit

Permalink
days was already defined
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlong committed Nov 18, 2023
1 parent 29b5bc1 commit e03fa2d
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/iso.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,26 +167,28 @@ const loadStats = () => {
let currentStreakStart = null
let currentStreakEnd = null

const days = [...document.querySelectorAll('.js-calendar-graph-table tbody td.ContributionCalendar-day')].map((d) => {
return {
date: new Date(d.dataset.date),
week: d.dataset.ix,
color: getSquareColor(d),
tid: d.getAttribute('aria-labelledby')
const dayNodes = [...document.querySelectorAll('.js-calendar-graph-table tbody td.ContributionCalendar-day')].map(
(d) => {
return {
date: new Date(d.dataset.date),
week: d.dataset.ix,
color: getSquareColor(d),
tid: d.getAttribute('aria-labelledby')
}
}
})
)

const tooltips = [...document.querySelectorAll('.js-calendar-graph tool-tip')].map((t) => {
const tooltipNodes = [...document.querySelectorAll('.js-calendar-graph tool-tip')].map((t) => {
return {
tid: t.id,
count: getCountFromNode(t)
}
})

const data = days.map((d) => {
const data = dayNodes.map((d) => {
return {
...d,
...(tooltips.find((t) => t.tid === d.tid) || {})
...tooltipNodes.find((t) => t.tid === d.tid)
}
})

Expand Down

0 comments on commit e03fa2d

Please sign in to comment.