Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transformDayElement params to value no date is null how to get date #166

Open
zhangwei900808 opened this issue Oct 10, 2021 · 0 comments
Open

Comments

@zhangwei900808
Copy link

when I set value below

<CalendarHeatmap
  startDate={new Date('2021-01-01')}
  endDate={new Date('2021-04-01')}
  values={[
    { date: '2021-01-01', count: 12 },
    { date: '2021-01-22', count: 122 },
    { date: '2021-01-30', count: 38 },
    // ...and so on
  ]}
transformDayElement={(rect, value, index) => {
          console.log('rect=', rect, ',value=', value, ',index=', index)
          const tooltip = (
            <Tooltip mouseEnterDelay={0.001} mouseLeaveDelay={0.001} arrowPointAtCenter placement="top"
                     title={`${value && value.date ? value.date.slice(0, 10) : ''} 数量: ${value && value.count}`}
                     key={index}>{rect}</Tooltip>
          );
          return tooltip
        }}
/>

but tooltip is show value is null how to get the date
image

zhangwei900808 added a commit to zhangwei900808/react-calendar-heatmap that referenced this issue Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant