ankane / react-chartkick

Create beautiful JavaScript charts with one line of React
https://chartkick.com/react
MIT License
1.2k stars 58 forks source link

Issue with dates and timezones #47

Closed DemidenkoAndrey closed 4 years ago

DemidenkoAndrey commented 4 years ago

Hello!

I have an issue with dates and I suppose timezones. Everything is ok when I use chartjs, but when I use highcharts all dates shiffted to 1 day back and label shows date with time.

See examples for same data:

Highcharts: https://prnt.sc/q6oqrs Chartjs: https://prnt.sc/q6ork4

I suppose there is an issue with timezone, because my local timezone is GMT+3. And as you can see on highcharts it shows 21:00.

ankane commented 4 years ago

Hey @DemidenkoAndrey, thanks for reporting. Can you share an example of what the data prop looks like?

DemidenkoAndrey commented 4 years ago

@ankane [..., ['2019-12-05', 1.14724884289812]]

ankane commented 4 years ago

Hey @DemidenkoAndrey, it looks the issue is Highcharts shows UTC by default while the other charting libraries show local time (and dates are parsed as local time). I'll address this in the next major version of Chartkick.js (as users may depend on the existing inconsistent behavior), but for now, you can set library={{time: {useUTC: false}}}.