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

Chart tooltip is one day back #43

Open
epoberezkin opened this issue Apr 16, 2017 · 10 comments
Open

Chart tooltip is one day back #43

epoberezkin opened this issue Apr 16, 2017 · 10 comments
Labels

Comments

@epoberezkin
Copy link
Contributor

See https://npm-stat.com/charts.html?package=ajv
or https://npm-stat.com/charts.html?package=ajv&from=2017-04-01&to=2017-04-16

Particularly on the second one you can see that the date one the axis is correct and in the tooltip (when you mouse-over the dot on the chart) it is one day back

@pvorb
Copy link
Owner

pvorb commented Apr 17, 2017

Yep, I know this issue. It has been introduced in PR #37, but I didn't recognize it before deploying that change and didn't feel like it's that important.

I guess it is caused by some timezone problem. Can you tell me in which timezone you tested this behavior?

@epoberezkin
Copy link
Contributor Author

In GMT (UTC +1 now)

@pvorb pvorb added the bug label Sep 23, 2018
@pvorb pvorb changed the title [bug] Chart tooltip is one day back Chart tooltip is one day back Oct 3, 2018
@epoberezkin
Copy link
Contributor Author

looks fixed

@pvorb
Copy link
Owner

pvorb commented Feb 3, 2019

Are you still in UTC+1? Because I haven't changed the calculation, I think.

@epoberezkin
Copy link
Contributor Author

Maybe it’s because it’s UTC now...

@pvorb
Copy link
Owner

pvorb commented Feb 3, 2019

That sounds likely.

@ozzyogkush
Copy link

ozzyogkush commented Jun 2, 2019

I am in Eastern Time, I'm seeing an issue on the default view for a package where the both the "To" field and the date in the graph is always the day before (ie if today is June 2nd, both are June 1st). IMHO it should give data for the current day even if the day is not over.

@vlzhr
Copy link

vlzhr commented Sep 24, 2019

Looks like the bug appears in a chart generation. The plain API stat is correct while the chart lies
image
image

@pvorb
Copy link
Owner

pvorb commented Sep 24, 2019

@ozzyogkush

IMHO it should give data for the current day even if the day is not over.

npm-stat.com cannot give numbers before a day is over, since NPM starts calculating the numbers on midnight UTC.

@vlzhr Yes, everything is fine in the back end, but time zones in JavaScript are awful. Highcharts uses Date objects for displaying the x-axis and 2019-09-23T00:00:00Z might be displayed as Sunday, Sep 22, 2019 (the actual time is omitted) if your offset from UTC is negative.

@seam345
Copy link

seam345 commented Nov 15, 2019

looks like this is linked to the issue I just opened #83 where I noticed the timezone moving forwards has caused it to duplicate a date and going back has caused it to skip a date. This results in the graph appearing as above.

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

No branches or pull requests

5 participants