-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Timeseries off by 1 day #268
Comments
Could this be the issue? |
Yep, that fixed it. Thanks! Shouldn't that be the default setting? Kinda confusing if the data being passed in doesn't match the graph output. The timezone should be handled on the server side before passing the data in... just my opinion. |
Hi, It seems working well in my environment. Please let me explain.. If If So, I think it would work well with |
It only works for me when localtime = false. Not sure why that is. It means that for the charts to work properly (in my environment) i must manually set localtime=false. Im just questioning why the timezone is being converted at all on the client side. Seems like this functionality can be removed, making the code smaller, and the charts just show whatever is passed in... no conversion needed. I cant think of a case where anyone would want UTC conversion on the client side. |
Thanks for the information. Umm.. I'm not sure too why the time is not converted as I expected.. For conversion of time, you're right. The time should not be converted on the client side. (In my environment) c3 does not convert as default. So if it works well, we don't think the timezone on the client side at all. The case where conversion needed is that the time needs to be shown as the viewer's timezone with same data. It might be rare case though (so, this is not default). Anyway, I'll keep working on this. |
I may have narrowed it down a bit. On line 2075 in the parseDate function, the __data_x_format variable is undefined. Im passing in the same axis data as the example on the site.
The conversion seems to be happening on new Date(date); Hope this helps, thanks for all the hard work and the amazing library! |
Thank you for your help. I think you're right. Without __data_x_format, the date is not converted properly. I fixed the default of I'll release the next version that includes this fix soon. Thank you! |
Amazing work, thank you |
I released 0.2.0 that includes this fix. So I'll close this issue. Thank you. |
Response From The Server: Error: Failed to parse x '2015-07-01' to Date object |
I first ran into this issue on my own project, then noticed that its also happening on the Timeseries Chart example.
http://c3js.org/samples/timeseries.html
The chart should start on 2013-01-01 and end 2013-01-06 ... but the chart shows it shifted 1 day into the past. So it starts on 2012-12-31 and ends on 2013-01-05.
This causes the data points to be shown on the wrong dates.
The text was updated successfully, but these errors were encountered: