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

Allow users to configure their locale and provide a default date format based on locale #909

Open
thelooter opened this issue Jun 22, 2024 · 7 comments

Comments

@thelooter
Copy link

Currently, dates are presented as mm/dd/yyyy.
This is not intuitive for many people, and has lead to multiple wrong entries for me.
Having the ability to configure how you want the date to be presented would be really helpful

@claudey
Copy link
Contributor

claudey commented Jun 22, 2024

This is an interesting problem I may want to solve.

@thelooter
Copy link
Author

I probably should have mentioned that before, but I would to use dd/mm/yyy notation

@zachgoll zachgoll changed the title Add localized Date representation Allow users to configure their locale and provide a default date format based on locale Jun 24, 2024
@zachgoll
Copy link
Collaborator

zachgoll commented Jun 24, 2024

I think @vsme had a good start to this in #889. While we cannot accept bulk translations right now, I think this would be a good opportunity for us to configure the ability for users to set their preferred locale.

Since date formats are set once for locale, this would be a small enough scope for us to introduce without adding much overhead.

The requirements should probably be something like:

  • User should be able to set their preferred date format, and app respects this setting
  • User should be able to set their preferred language (disable for now, but we could have a placeholder in the UI with a "coming soon")

I think we'll want to set the locale via the strategy outlined here:

https://edgeguides.rubyonrails.org/i18n.html#setting-the-locale-from-user-preferences

@justinfar do we have some designs for this that we could post on this issue?

@justinfar
Copy link

On it!

@justinfar
Copy link

justinfar commented Jun 24, 2024

Just added a page in the community file

Here's how it's looking:

image

I've basically just added a Soon tag (that we use within the Security page) within the language field and added the Date format field with 5 of the most common date formats.

@zachgoll
Copy link
Collaborator

@justinfar looks good to me!

This issue is up for grabs for anyone who wants to tackle it. Otherwise I'll circle back and knock it out after some of the investment portfolio work I'm doing.

@thelooter
Copy link
Author

thelooter commented Jun 24, 2024

Another idea would be still activating the locale selection with a note next to it stating that it only applies to dates for now. This would already put the data in a model that can easily be applied to other things. That way you could gradually add more places to use it, like the date or the default suggested Currency

But i dont know enough about the codebase to judge if this is a viable solution

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

No branches or pull requests

4 participants