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

DoB format should follow system locale #7801

Closed
howardlowndes opened this issue Dec 10, 2023 · 10 comments
Closed

DoB format should follow system locale #7801

howardlowndes opened this issue Dec 10, 2023 · 10 comments
Labels
type:enhancement Proposed improvement, new feature, or extension -- not a defect works-as-designed The issue is working as designed or the issue has already been fixed.

Comments

@howardlowndes
Copy link

Version

1.11.4

What browsers are you seeing the problem on?

This problem isn't browser related

What happened?

When creating a new user the system prompt for a mandatoy Date of Birth.
It will only accept a DoB in US format (M/D/Y).

What should have happened?

The requested field should accept dates according to the system locale.

@ehuelsmann
Copy link
Member

When creating a new user the system prompt for a mandatoy Date of Birth.

Is this as part of the database creation procedure (in setup.pl)? Or is this in the regular application (login.pl)?

@howardlowndes
Copy link
Author

howardlowndes commented Dec 10, 2023 via email

@neilt neilt added the type:bug Bug that will be worked on as resources permit label Dec 10, 2023
@ehuelsmann ehuelsmann added type:enhancement Proposed improvement, new feature, or extension -- not a defect works-as-designed The issue is working as designed or the issue has already been fixed. and removed type:bug Bug that will be worked on as resources permit labels Dec 25, 2023
@ehuelsmann
Copy link
Member

Although I understand why this would be perceived to be a bug, this is how LedgerSMB was designed: when there is no explicit date preference setting (which there isn't for the default user which gets created in setup.pl), the iso standard format gets selected.

The same elements which apply this logic are also used for setup.pl and since setup.pl does not have a user, the date preference setting is always missing, defaulting the date format to the iso standard.

@howardlowndes
Copy link
Author

howardlowndes commented Dec 26, 2023 via email

@ehuelsmann
Copy link
Member

It doesn't comply with the ISO standard which is YYYYMMDD.

I thought the same for a long time but according to the Wikipedia article (https://en.m.wikipedia.org/wiki/ISO_8601) both with and without separating dashes are allowed...

@howardlowndes
Copy link
Author

howardlowndes commented Dec 26, 2023 via email

@ehuelsmann
Copy link
Member

Ok. Even though I create new companies while manually testing the software about a dozen times a day, I never noticed the date format is set to m/d/yyyy on my system too. As it turns out, this setting does follow "system locale" to some extent.

First, it should be noted that webpages do not have a thing like "system locale". They can use the value "navigator.language" to access the browser's language selection, but there's no way to tap into system defaults. Browsers themselves can do this, obviously. When we were to use <input type="date" /> instead of our own widget (not sure about its behavior with respect to the enclosing UI or the in-browser selected locale preference). However, that widget is rendered differently on each browser and does not align with the style of the widget library we are using.

Now, I was able to change the "m/d/yyyy" preference in the setup.pl page by changing the language setting on my browser. Switching from the preferred "en-US" to "nl-NL", the input format switched to dd-mm-yy. It seems that the page is sensitive to preferences/language selections, but your date formatting preference may not be aligned with your language preference...

@howardlowndes
Copy link
Author

howardlowndes commented Dec 26, 2023 via email

@howardlowndes
Copy link
Author

howardlowndes commented Dec 27, 2023 via email

@ehuelsmann
Copy link
Member

The fact that this does not work for the en_AU locale it's an upstream but in our widget library (Dojo Toolkit). It's not something we can fix on our side. Unfortunately, I'm not expecting them to do anything about it because development is non existent. (We're working to migrate to a new library).

Given the above, I think there is no need to keep this ticket open. @ylavoie please reopen if you feel like chatting Dojo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Proposed improvement, new feature, or extension -- not a defect works-as-designed The issue is working as designed or the issue has already been fixed.
Projects
None yet
Development

No branches or pull requests

3 participants