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

Hours subdomain is not honoring local browser time #476

Open
empireshades opened this issue Jan 31, 2024 · 1 comment
Open

Hours subdomain is not honoring local browser time #476

empireshades opened this issue Jan 31, 2024 · 1 comment

Comments

@empireshades
Copy link

I've commented on other issues but I wanted to log this here officially as well. When I use domain: day with subdomain: hour, the timezone appears in UTC and does not honor my local browser time. I've tried this with multiple Date formats in different input timezones including string and also epoch. The only thing that seems to make a minor difference is if I set the timezone to 'America/Los_Angeles' but even then the time only gets shifted by an hour for the epoch entry only. Thank you.

Full example: JS Fiddle

JS:

const cal = new CalHeatmap();
cal.paint({
  range: 5,
  domain: {
    type: 'day'
  },
  subDomain: {
    type: 'hour'
  },
  date: {
    start: new Date('2023-03-09'),
    //timezone: 'America/Los_Angeles'
  },
  data: {
    defaultValue: 0,

    source: [{
        date: new Date('Mar 10 2023 07:00:00 GMT-0700'),
        rate: 3
      },
      {
        date: new Date('Sat Mar 11 2023 08:00:00 GMT+0800 (Chinese Standard Time)'),
        rate: 1
      },
      {
        date: 1678606470000, //GMT: Sunday, March 12, 2023 7:34:30 AM
        rate: 4
      },
    ],
    x: 'date',
    y: 'rate'
  },
  scale: {
    opacity: {
      baseColor: 'red',
      domain: [0, 5],
    }
  }
}, [
  [Tooltip]
]);
@Tang59
Copy link

Tang59 commented Feb 5, 2024

Same problem here

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

2 participants