Usermin Date / Locale problem

SYSTEM INFORMATION
OS type and version RHEL 9
Webmin version 2.011
Usermin version 1.860

The date in Usermin defaults to the language, not the locale, so in Australia which uses dd/mm/yyyy, Usermin is using the US version of mm/dd/yyyy

I have found how to edit it, but have to do every user for each domain - less than ideal.

Can Usermin read the locale from the host OS during install?

Can this be fixed for existing installs or do I need to start working through every user account?

1 Like

Is there at least a way that I can change to Locale for all users in all domains, apart from individually logging into each user account?

To add to the first post above. This happens because we both use English and therefore Usermin decides we must be in the US.

it shows ok for me

That might be due to different OS, from what I can find you are running Rocky 8.

Though I just checked on a RHEL8.7 test server and it is showing M/D/Y

Operating system Redhat Enterprise Linux 8
Usermin Version 1.860
Authentic theme version 20.00
Time on system 01/25/2023 3:32:58 AM

This has just been updated and is using Webmin 2.013, Virtualmin 7.5

I’m still running centos 7
this is a date and time setting in usermin

also have you adjusted webmin

Mine is the same, even if that worked it would mean changing each user.
Webmin is also the same as yours.

I have checked anything that I can think of, it appears to be a simple programming oversight and I was hoping staff might investigate.

Looks like I best start manually changing each user. Yay!

I can’t ever remember changing the format. Just as a test I created a test user and logged into usermin and dates fine its using the aussie format for date. Not sure why you system would be different, maybe someone on @staff might know.

Using this page you can change it for each user:

And globally for all users, it can be changed in Webmin ⇾ Usermin Configuration: Usermin Module Configuration / Read Mail / Default user preferences page:

I hope you can fine it! :slight_smile:

1 Like

Thanks Ilia, Usermin and Webmin are already set that way, but still it displays as MM/DD/YY

The only fix I have found is per user, Login to webmail /Usermin / Usermin / Change Language / set Locale to Manual, then select English (Australia).

Messy for sure.

Per Domain in Virtualmin, Administration Options / Switch to Server’s Admin / Virtual Server Details / Webmin Modules / Change Language and Theme / set Locale to Manual and then select English (Australia)

Still messy, but then also works for new users in that domain. Previously created users don’t appear to be affected, but I have done so many tests I am getting a bit confuddled!

Eitherway, if Usermin could just read the Locale from the server OS - which it may be doing on eg Centos 7 that Stefan uses, it would save a lot of messing about for me, and probably other people if it is an RHEL9 issue.

Could it be that I need to make a change at the OS level?

Agreed, ideally we need to centralize that. And I already tried to do that by putting this all under single Change Language and Theme page to control for a user and to Webmin (Usermin) Configuration: Language and Locale page to set it globally for all users. This isn’t that bad.

But I almost completely forgotten that mail has its own date format options for some reason … Probably @Jamie could explain the reason behind it better, and/or remove those completely to rely only on whatever is defined on Webmin side (or Usermin side).

Could it be that I need to make a change at the OS level?

Not sure what you mean exactly … but the main obstacle is that we have two separate date formats (technically).

The old one is when the date generated on the server side, in the server executed scripts, which never reach/output to UI. In this case, it’s controlled by Server generated date format option in Locale configuration / Manual … the old location for this date control feature was Webmin (Usermin) Configuration: User Interface page, i.e. raw dateformat option. This old feature is not very flexible in providing locale based formatted date/time.

The new one, that happens on the theme side, which only receives the timestamp from the server, and process it in UI according to finesse user preferences. It’s much more flexible and powerful.

The best solution would be is to pre-process date/time solely on the server side. But that would require a lot of work (on Perl side) to support different formats and locales. This is not trivial. Actually, it’s like a separate project on its own.

I am trying to work out why Stefan doesn’t have this issue with Centos 7, so I spun up a clean minimal C7 server and installed Vmin - same problem!

When installing C7 (and any RHEL etc) I always make a point of selecting English (Australia) and then setting the timezone to my city in the install process.

Prior and after VMin install and Wizard, localectl status shows:
System Locale: LANG=en_AU.UTF-8
VC Keymap: us
X11 Layout: us

Then both Webmin and Usermin are set to use DD/MM/YYY but they then display in US format.
Webmin status screen, Recent Logins - MM/DD/YYY - so it’s not just mail.

It appears that Webmin and Vmin are ignoring all the settings, the only way to deal with it is by changing Language and Themes by setting Locale to Manual and then selecting English (Australia)

I have now tried with Centos 7 and RHEL 8 & 9, so it’s not an OS version issue.

Stefan, any thoughts why your C7 works and my fresh new C7 doesn’t?

Ilia, can you make the xMin family read the locale and not just the language, and why do the programs ignore being set to use DD/MM/YYY?

@Ilia the date formatting is done in the theme using some client-side Javascript, right?

Not really, I can’t remember doing anything special.

Steve

looking at this the dates appear inconsistent across the whole project
quick example :

hit view logs and you get

I have set my locale to english (appears to be en_US.UTF-8) but I would prefer it to be en_GB.UTF-8

I have experimented with changing locale on the OS, makes no difference to Web/Virtmin.

Well, yes but not all. I explained the problem in details it on the comment above.

I would personally loved to remove all extra code, and solely rely on localectl output and build human readable dates/time on the server side.

As writing this, and looking at the code I remembered that we already do/have something familiar to this (i.e. respect/pass browser defined language/locale to process dates/time). There is an option called acceptlang which is controlled in UI on Webmin ⇾ Webmin Configuration: Language and Locale page with Use language specified by browser? option. So, if you set it to Yes and your browser language is set to English (Australia) (or whatever) then the whole UI will use that language and display dates accordingly too.

I wouldn’t mind dropping completely date/time processing on UI side and use DateTime::Locale instead. @Jamie, it would require rework on Webmin side – how do you feel about that?

I tried this in Firefox, closest option was English GB which fixed the Wemin System Information, Recent Logins, but didn’t appear to change anything in Virtualmin.