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

Locale based time formatting for Chart.js graphs #938

Closed
mcspr opened this issue Feb 27, 2018 · 2 comments
Closed

Locale based time formatting for Chart.js graphs #938

mcspr opened this issue Feb 27, 2018 · 2 comments

Comments

@mcspr
Copy link
Contributor

mcspr commented Feb 27, 2018

New Chart.js graphs are no longer using 24 hour style for ru-RU locale as google charts did.
default
default

At least for tooltip, I noticed that it is using moment.format with locale based output. But there are no locales! Maybe this has something to do with packaging? (include moment-with-locales.js instead of moment.js)
default
https://github.com/home-assistant/home-assistant-polymer/blob/0ab240c678260e5ec9924407440415e3679f282f/src/components/entity/ha-chart-base.html#L202-L208

Same format spec used inside timeline chart library:
https://github.com/fanthos/chartjs-chart-timeline/blob/82215e441b379c2776f9ab5443db849fc5ffe0bd/timeline.js#L446-L449

Edit: referenced chartjs-chart-timeline

@balloob
Copy link
Member

balloob commented Feb 27, 2018

Moment with locales is too big to include. We should instead use date formatters in hassUtil.

@matejdro
Copy link

matejdro commented Sep 19, 2020

Charts are still displaying AM / PM for me on 0.115. Has this regressed?

@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants