0

I'd like to leverage @nivo/calendar to display a year's worth of data (every single day of the year). All my dates are within the valid range. If I set the start date to 2016-01-01 (where YYY-MM-DD), I get two year calendars (2015+2016). Setting it to 2016-01-02 fixes the issue (shows only 2016), but then I missing data for the first day of the year. I have a hunch this is some sort of timezone bug. Has anyone run into this issue?

from="2016-01-02" // setting from to 2016-01-01 causes bug where two years are shown instead of one
to="2016-12-31"

You can see the issue here: https://codesandbox.io/s/nivo-calendar-single-year-forked-lemu8i

rsilva
  • 178
  • 3
  • 18
  • The issue isn't reproduced in your provided sample for me, which would reenforce that it is an environment difference (most likely time zone). The component also supports javascript Date objects for `to` and `from`, maybe you will have better luck with those? i.e. `from={new Date(2016,0,1)}` and `to={new Date(2016, 11, 31)}`. If that still doesn't work maybe use a UTC date. i.e. `from={new Date(Date.UTC(2016,0,1))}`. – Jacob Smit Feb 05 '23 at 22:30

0 Answers0