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

[Timezone] Heatmap dates getting duplicated between end of previous week and start of next week #157

Closed
kimili opened this issue Apr 20, 2018 · 5 comments · Fixed by #377

Comments

@kimili
Copy link
Contributor

kimili commented Apr 20, 2018

Expected Behaviour

The heat map date calculation should not duplicate dates.

Actual Behaviour

The last day of a week in the heat map is getting doubled as the first. Note that this also has the effect of incorrectly rendering the last day of a month and the first day of the next month, so the months do not stack correctly.

Steps to Reproduce:

  • Simply render the demo and examine the dates on the end of one week and the beginning of the next week.

Some examples:

May 7, 2016
screenshot 2018-04-20 15 26 23 screenshot 2018-04-20 15 26 32

October 1, 2016
screenshot 2018-04-20 15 26 39 screenshot 2018-04-20 15 26 46

Frappé Charts version: 1.1.0

I'll look into it and see if I can figure out whats going on and open a pull request if I can patch it.

@pratu16x7
Copy link
Contributor

Browser?

On Chrome:
screen shot 2018-04-21 at 1 06 27 am
screen shot 2018-04-21 at 1 06 37 am
screen shot 2018-04-21 at 1 06 51 am
screen shot 2018-04-21 at 1 06 59 am

@kimili
Copy link
Contributor Author

kimili commented Apr 20, 2018

@pratu16x7 - It's very strange that you're seeing it correctly and I am not. I noticed the problem initially in Safari (11.0.3), but I checked in the latest versions of Chrome, Firefox, and Opera - all on MacOS 10.13.3. I'm seeing it constantly incorrect in all those browsers.

Can you double check https://frappe.github.io/charts/ in different browsers, or in an incognito window to eliminate the possibility of caching issues?

@kimili
Copy link
Contributor Author

kimili commented Apr 20, 2018

You can see there's something going wrong - at least on my end - in the startOfWeek calculation. This is a log out of each week's data in the getDomainConfig() method. All the startOfWeek values should be on a Sunday:

screenshot 2018-04-20 16 02 58

@kimili
Copy link
Contributor Author

kimili commented Apr 20, 2018

@pratu16x7 - OK, it looks to be a timezone - and time of day - specific problem. When I set my clock to GMT, it works as expected. However, when I seeing to my local timezone - Eastern Standard Time - that's when the issue surfaces.

I think how days are being calculated to render the grid isn’t taking into account time zone offsets and perhaps daylight savings time, so the day additions get thrown off.

I'll continue digging and look for a fix.

@pratu16x7 pratu16x7 changed the title Heatmap dates getting duplicated between end of previous week and start of next week [Timezone] Heatmap dates getting duplicated between end of previous week and start of next week Apr 21, 2018
@Neo-Desktop
Copy link

Just to bump this up, this behavior is still present and I feel like it's related to #318

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

Successfully merging a pull request may close this issue.

3 participants