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

time range will be incorrect if default rangeSelector.selected is 1 year range #966

Closed
ghost opened this issue May 16, 2012 · 5 comments
Closed

Comments

@ghost
Copy link

ghost commented May 16, 2012

Hi,
if I set default rangeSelector.selected to 1year range, when I open the page, the time range will be May,16 2011 to May,15 2012.
but if I select 1 year range button again (click 1y again), the time range will become May,15 2011 to May,15 2012

while May,15 2011 to May,15 2012 is the correct time range.

see this fiddle:
http://jsfiddle.net/gh/get/jquery/edge/highslide-software/highcharts.com/tree/master/samples/stock/demo/basic-line/

the default rangeSelector.selected is 4 in the above fiddle.

@ghost
Copy link
Author

ghost commented May 17, 2012

sorry, please visit this url instead:
http://jsfiddle.net/vGuQ4/

@ghost
Copy link
Author

ghost commented May 17, 2012

when default time-range is "6m", this problem will appear as well:
http://jsfiddle.net/HQ6Hg/

@JonDegn
Copy link

JonDegn commented Feb 24, 2014

This issue still seems to be occurring. I made a post on the forums about it here: http://forum.highcharts.com/topic28805/

@TorsteinHonsi
Copy link
Collaborator

It seems to have changed since the original post though - now it shows consistently from May 10 to May 10. A little debugging shows that the time span shown is exactly one year, from 2012-05-10 00:00:00 to 2013-05-10 00:00:00. But since these dates are midnights, the range selector will show both full dates. I'm not sure how to handle this. We could set the last date to 2013-05-09 23:59:59 but then there is data for May 10 2013 that will not show. In the other end, we would need to push the date one day forward, to 2012-05-11 00:00:00, but then we're technically not showing a full year anymore, at least not if the data has higher resolution than one data point each day.

@oysteinmoseng
Copy link
Member

This seems to be working with current code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants