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

Internationalization? #458

Open
yuhangxiaocs opened this issue Nov 4, 2020 · 0 comments
Open

Internationalization? #458

yuhangxiaocs opened this issue Nov 4, 2020 · 0 comments

Comments

@yuhangxiaocs
Copy link

yuhangxiaocs commented Nov 4, 2020

Is there a way to change local time format?

I am working on a project using this library, and I want to change the time format to a local date format like this:
image

I cannot find a convenient way to do this in this library.
After searching the source code, I realized this library used the d3-time-format library for time formatting. So I import this library and use its timeFormatDefaultLocale method to set up local time format in a global procedure.

import { timeFormatDefaultLocale } from 'd3-time-format';

timeFormatDefaultLocale({
  // content of JSON file from https://github.com/d3/d3-time-format/tree/master/locale 
});

I feel this is a bit hacky. I am wondering if there is a better way to do this? Appreciate!

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

1 participant