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

Problem with timestamp and timezone #387

Open
ValentinS33 opened this issue Oct 5, 2023 · 6 comments
Open

Problem with timestamp and timezone #387

ValentinS33 opened this issue Oct 5, 2023 · 6 comments

Comments

@ValentinS33
Copy link

Hello!

I tried this code:

const cal = new CalHeatmap()

cal.paint({
  data: {
    source :  [{t: 1696428211000, value: 6}],
    x : 't',
    y : 'value',
    groupY : 'sum'
  },
  range: 2,
  date: { timezone: 'Europe/Paris', start: new Date('2023-10-4') },
  domain:{
    type: "day",
    label:{
      position: 'top'
    }
  },
  subDomain:{
    type: "hour",
    label: 'H'
  },
  scale: {
    color:{
      scheme: 'Cool',
      type: 'linear',
      domain: [0,30]
    }
  }
});

But even if I change the timezone, the date is always the same (in UTC).
I also tried a date like 2023-10-04T14:03:31.040000+00:00 or 2023-10-04T16:03:31.040000+02:00 but same problem.

Thank you!

@mattjohnsonpint
Copy link

Perhaps this is the problem?

@ValentinS33
Copy link
Author

I think it works by removing this line, thanks!

@ValentinS33
Copy link
Author

I believe it was good because the data was displayed in the right slot (with domain: day, subdomain: hour), but I have a bug today because of this deleted line (with domain:week, subdomain: day):

Only 6 days in week 43:
image

Problem on week 42:
image

@empireshades
Copy link

@ValentinS33 did you have any luck in getting this to appear in the proper local timezone?

@ValentinS33
Copy link
Author

No :( For the moment, I use only Europe/Paris timezone so I set .utcOffset(1) and and I will change to .utcOffset(2) when there is the time change and the 2 hour difference in France...

@yqchilde
Copy link

yqchilde commented May 7, 2024

也许这就是问题所在?

👍🏻

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

No branches or pull requests

4 participants