LedgerSMB icon indicating copy to clipboard operation
LedgerSMB copied to clipboard

DoB format should follow system locale

Open howardlowndes opened this issue 2 years ago • 9 comments

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.

howardlowndes avatar Dec 10 '23 06:12 howardlowndes

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)?

ehuelsmann avatar Dec 10 '23 09:12 ehuelsmann

Create User in setup.pl

On Sun, 10 Dec 2023, 20:57 Erik Huelsmann, @.***> wrote:

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)?

— Reply to this email directly, view it on GitHub https://github.com/ledgersmb/LedgerSMB/issues/7801#issuecomment-1848915009, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMS2F7Q5NXRFJBWYBDLYHBTYIWBSPAVCNFSM6AAAAABAOKQ54CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBYHEYTKMBQHE . You are receiving this because you authored the thread.Message ID: @.***>

howardlowndes avatar Dec 10 '23 15:12 howardlowndes

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.

ehuelsmann avatar Dec 25 '23 19:12 ehuelsmann

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

On Tue, 26 Dec 2023, 06:45 Erik Huelsmann, @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/ledgersmb/LedgerSMB/issues/7801#issuecomment-1869098280, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMS2F7QHU43ZKALOZDJ4HZLYLHJVDAVCNFSM6AAAAABAOKQ54CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRZGA4TQMRYGA . You are receiving this because you authored the thread.Message ID: @.***>

howardlowndes avatar Dec 26 '23 01:12 howardlowndes

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...

ehuelsmann avatar Dec 26 '23 09:12 ehuelsmann

I agree, both YYYYMMDD and YYYY-MM-DD are ISO, but not m/d/yyyy, which is the US format, and is what setup.pl calls for.

On Tue, 26 Dec 2023 at 20:19, Erik Huelsmann @.***> wrote:

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...

— Reply to this email directly, view it on GitHub https://github.com/ledgersmb/LedgerSMB/issues/7801#issuecomment-1869396279, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMS2F7V37WR2FCFFRTTZMWTYLKJB5AVCNFSM6AAAAABAOKQ54CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRZGM4TMMRXHE . You are receiving this because you authored the thread.Message ID: @.***>

-- Howard.

When you want a computer system that works, just choose Linux; When you want a computer system that works, just, choose Microsoft.

howardlowndes avatar Dec 26 '23 09:12 howardlowndes

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...

ehuelsmann avatar Dec 26 '23 11:12 ehuelsmann

I'll check that out

On Tue, 26 Dec 2023, 22:03 Erik Huelsmann, @.***> wrote:

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 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...

— Reply to this email directly, view it on GitHub https://github.com/ledgersmb/LedgerSMB/issues/7801#issuecomment-1869461388, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMS2F7TAJYVYF3TJIQUNBLLYLKVJLAVCNFSM6AAAAABAOKQ54CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRZGQ3DCMZYHA . You are receiving this because you authored the thread.Message ID: @.***>

howardlowndes avatar Dec 26 '23 17:12 howardlowndes

My system locale is English(Australian) as it is in Chromium also.

On Wed, 27 Dec 2023 at 04:45, Howard Lowndes @.***> wrote:

I'll check that out

On Tue, 26 Dec 2023, 22:03 Erik Huelsmann, @.***> wrote:

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 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...

— Reply to this email directly, view it on GitHub https://github.com/ledgersmb/LedgerSMB/issues/7801#issuecomment-1869461388, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMS2F7TAJYVYF3TJIQUNBLLYLKVJLAVCNFSM6AAAAABAOKQ54CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRZGQ3DCMZYHA . You are receiving this because you authored the thread.Message ID: @.***>

-- Howard.

When you want a computer system that works, just choose Linux; When you want a computer system that works, just, choose Microsoft.

howardlowndes avatar Dec 27 '23 04:12 howardlowndes

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.

ehuelsmann avatar Feb 25 '24 07:02 ehuelsmann