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
Date Sat Mar 11 2023 00:44:06 GMT+0800 (Chinese Standard Time) is recorgnized as Mar 10 in heatmap #337
Comments
How are declaring the date in your data ?
or
|
new Date() one |
Are you using a timezone ? https://cal-heatmap.com/docs/options/date#timezone |
No, I'm not setting it in my code, cause I want it to change with user's timezone. |
So I guess you're located yourself in the +8 timezone ? |
yes |
Do you see the same issue here ? https://jsfiddle.net/3nsrpvL5/ If yes, does enabling the timezone (uncomment the timezone line) solve the issue ? |
I've tried this. However, it doesn't work for me. |
For consistency, date format should always follow ISO 8601 (https://cal-heatmap.com/docs/options/data#x), using any other format may lead to bug, such as the timezone now recognized.
The best and robust way will be to use a timestamp format for your dataset |
Just try with |
Hello, sorry to bother you again.
No matter I use origin format (mix of 2 types) Would you like to tell me what my problem is? Is it because there is anything wrong with my stitched data? |
Why don't you just pass |
I am having the same problem. A date of 2023-05-02T03:00Z (whether in string form or as a numeric time) will be put in the May 2 bucket instead of the May 1 bucket in the heatmap regardless of the time zone. Since my browser is PDT, it should default to May 1. It suspect the problem is here: cal-heatmap/src/helpers/DateHelper.ts Lines 160 to 161 in d9a8e3c
It sets the time zone to cal-heatmap/src/helpers/DateHelper.ts Line 206 in d9a8e3c
This makes the cut-off for the buckets always UTC and ignores the time zone. I may be misunderstanding the code but that's what seems to be happening. |
I am having the same issue even though I set the timestamp to my local time. My domain is day and subdomain is hour (and also a custom hour template). My data looks like this:
But the graphs always render as only UTC. Could it be because of the Thanks. |
Further contextHere is what I am using to draw the calendar:
and here is a snippet of the CSV that is being called:
|
Thank you, buddy. You helped me solve a problem that had been bothering me all night |
Hello.
There's my data :
[.....,{ date: Date Fri Mar 10 2023 08:00:00 GMT+0800 (Chinese Standard Time), rate: 0 },
{ date: Date Sat Mar 11 2023 00:44:06 GMT+0800 (Chinese Standard Time),rate: 1},.....]
My cal-heatmap should show like this :
In block Mar 10, opacity should be 0, value should be 0. In block Mar 11, opacity should be 0.2, value should be 1.
But now, it works like this :
In block Mar 10, opacity is 0.2, value is 1. In block Mar 11, opacity is 1, value is null.
This means that my data for Mar 11 is recorgnized as data for Mar 10, and Mar 11 become null.
Can you tell me why and how to fix it?
The text was updated successfully, but these errors were encountered: