You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason seems to be that the groupByWeeks logic pads to one week but we try to access index 1 in the week array which may not be present. It is not clear to me if this could be fixed by accessing index 0 instead of one, or if groupByWeeks should add an extra week if there is only data for one week.
The text was updated successfully, but these errors were encountered:
nc-simv
changed the title
Cannot render calendar with o
Cannot render calendar with only one week of data
May 23, 2022
Hey. Thanks for reporting this. I was able to simplify the weekday label function, now it works for any amount of data. See this commit. Parsing the date to get the day index seems a bit silly when the week days array is left padded anyway.
If there is only one week of data there I get a
on https://github.com/grubersjoe/react-activity-calendar/blob/main/src/component/ActivityCalendar.tsx#L187
The reason seems to be that the
groupByWeeks
logic pads to one week but we try to access index 1 in the week array which may not be present. It is not clear to me if this could be fixed by accessing index 0 instead of one, or ifgroupByWeeks
should add an extra week if there is only data for one week.The text was updated successfully, but these errors were encountered: