Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Troubles with parsing strings containing timestamps as Time #161

Closed
toinebeg opened this issue Aug 30, 2021 · 0 comments · May be fixed by #162
Closed

Troubles with parsing strings containing timestamps as Time #161

toinebeg opened this issue Aug 30, 2021 · 0 comments · May be fixed by #162
Labels
type/feature-request Requested new feature or enhancement

Comments

@toinebeg
Copy link

toinebeg commented Aug 30, 2021

Hi,
First thank you for this great plugin !

I have an api that return time serie data as json objects, like this:

 "histogram": {
        "1630281600000": 32,
        "1629763200000": 21,
        "1629849600000": 60
      },

I can plug my data with the ~ operator but the date interpreted is wrong. It compute to something like "1635-05-02 00:00:00".

Thank to your test suite I found that it's a problem with how dayJs parse the string (https://day.js.org/docs/en/parse/string). I was able to fix it by adding a call to parseInt() before the value is given to dayJs.

Would you be interested in a PR with those changes ?

EDIT: Thinking a bit more about it, it could cause trouble if the string is a ISODate, I'm going to try and see how both cases can be handled.

Thanks for your attention.

@grafana grafana locked and limited conversation to collaborators Mar 7, 2022
@marcusolsson marcusolsson converted this issue into discussion #251 Mar 7, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
type/feature-request Requested new feature or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants