-
Notifications
You must be signed in to change notification settings - Fork 157
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
The dates on the heatmap are off by one #112
Comments
I'll be happy to look into it. Can you fork this CodeSandbox and pass in the exact data that you're using to see this behavior? https://codesandbox.io/s/73mk9wlyx |
Hi Kevin,
Thank you so much for responding! I was trying to use this in my capstone
project, but I couldn't get it to work correctly. I might not be inputing
the dates correctly, but I couldn't figure out how to fix it. Here's the
fork:
https://codesandbox.io/s/react-calendar-heatmap-basic-demo-zt0ny
Thanks for your help!
…-Joe
On Wed, Jul 17, 2019 at 10:41 PM Kevin Qi ***@***.***> wrote:
I'll be happy to look into it. Can you fork this CodeSandbox and pass in
the exact data that you're using to see this behavior?
https://codesandbox.io/s/73mk9wlyx
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#112>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKU7X7LH6O5NQNTX754JSZDP777BZANCNFSM4H5A7O7Q>
.
|
Hi @jyang81. Took a look and there's an issue with how dates are indexed. I'd like to fix this but it'll likely involve some pretty large changes to the component, and I can't guarantee when I'll be able to work on that. Sorry about that! |
Thanks for getting back to me Kevin! I understand this probably isn't your highest priority at the moment. I'll continue to use the package as is, until you are able to fix the issue. Just curious, are there any workarounds I can do to get it to show up correctly for now? If not, it's fine. I can wait until it's fixed. Thanks again, I appreciate it! |
There isn't a great workaround I can think of right now. I'll let you know if I can come up with something, or when this gets fixed for real. |
I just ran into this issue as well. For a workaround I just went through my data list and added 1 to the date for each entry. Also use a custom tooltip which accounts for the shift. @kevinsqi does this library factor in a leap year for the index? Haven't had much time to look at the code to see how things are implemented. |
Hi there! I see this PR is merged already but there haven't been any new releases since August 2019. |
Found a solution:
Your 67-73 lines should look like this: getNumEmptyDaysAtStart() { getNumEmptyDaysAtEnd() { |
I got around this by shifting my weekday labels by 1 🤷 not perfect, but got the job done for me for the time being: Ie:
|
I think it might be this function. https://github.com/kevinsqi/react-calendar-heatmap/blob/master/src/index.js, line 55 following When I remove the |
I figured out 1-line code change at my backend to address "1 day off" issue. Instead of assigning date field with the string "2022-12-19", Can't believe how I dig the internet to find this.
Now, with 1 line code change to ensure I store heatmap data with above format.
Will do more testing with remote team on different timezones. |
The day of the week is not rendering correctly. For example, my start date is '2019-03-11', which is a Monday and my end date is '2019-06-21' which is a Friday. But the calendar renders from "Monday 2019-03-12" to "Thursday 2019-06-21", which in incorrect.
My data point for 03-11 does not show up, and my data point for 03-12 shows up on the box where Monday 03-11 is supposed to be. The calendar renders boxes up to 06-21, but it is on Thursday instead of Friday. I'm not sure where the mixup is, but I cannot get it to render correctly.
The text was updated successfully, but these errors were encountered: