-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add option to show US-style date on chart #139
Comments
Hi, yes, it seems like a great idea for an enhancement 😊 However, the best approach would be to set a datetime format string in the config file (kr.config.json) to use in the chart, so everyone can configure their preferred format. What do you think of this idea? |
Actually, might be useful to have it configurable at runtime somewhere. Otherwise users would need a different instance of the library for different regions. In my case I'd like to be able to automatically switch the format to match the norm for the user, and I will have users both in and outside the US. |
It might be worth adding babel in here and having the locale be a param? https://babel.pocoo.org/en/latest/ is the library and format could be set like this I think:
If that locale param were passed from calling functions also, with the default set to en_GB, current behavior would be unchanged but easy to alter for the user. |
From my point of view, it's not the best option—it adds an unnecessary dependency with all that it entails. The best approach might be to pass the desired datetime format string directly within the class fraction, in my opinion. |
Generated charts always use the non-US style date of day/month/year. This format seems to even be hardcoded in this line:
kerykeion/kerykeion/charts/kerykeion_chart_svg.py
Line 408 in a327aa4
Possible to add an option/setting/switch that lets the user decide which date format to use?
The text was updated successfully, but these errors were encountered: