webmin / authentic-theme

Official theme for the best server management panel of the 21st Century
https://authentic-theme.com
MIT License
948 stars 164 forks source link

Cron job: Show two hour digits instead of only one ... #1663

Closed Sopor closed 1 year ago

Sopor commented 1 year ago

In the cron job i have a column called Run at times that will show when the next run will be.

In Sweden we have 24H and when we write the time we always use two hour digits even if the hour is between 0 and 9.

So if you can see here it will only show one digit as it was 12H: image

Is it possible to make it show 04:00, 03:10 and so on?

jcameron commented 1 year ago

Sure, we'll do this in the next release...

Sopor commented 1 year ago

If i open the cron job it do look like this: image

Why does it show two hour digits here and AM? How do i change it to show 24H?

iliajie commented 1 year ago

Why does it show two hour digits here and AM? How do i change it to show 24H?

You can change it here:

image
Sopor commented 1 year ago

As you can see above it use mm/dd/yy but this is what i have selected: image

I use global dates format.

iliajie commented 1 year ago

You should install deb or rpm package to install dependencies, rather than installing Webmin manually.

Sopor commented 1 year ago

I will only point out that if i change something in the Change Language and Theme and i leave without clicking on Make changes it will not tell me that i have made any changes to the page.

Sopor commented 1 year ago

You should install deb or rpm package to install dependencies, rather than installing Webmin manually.

I have always follow the instructions and that is to add jcameron-key.asc and install it.

If there are other ways to do it, I have no idea ...

iliajie commented 1 year ago

I have always follow the instructions and that is to add jcameron-key.asc and install it.

Please check these instructions: https://webmin.com/download/

Sopor commented 1 year ago

Please check these instructions: https://webmin.com/download/

That is something i never have seen. Must be something new ...

And i already have Webmin installed.

iliajie commented 1 year ago

OS?

Sopor commented 1 year ago

Debian Linux 11 (DietPi) and Ubuntu Linux 22.04.2.

That Webmin page did not looked like that the last time i was there, but it was a couple of years ago. This is how it looked: https://web.archive.org/web/20230105071228/https://www.webmin.com And those news are from November last year, so the site must have been changed a lot.

This is how i install Webmin: https://www.digitalocean.com/community/tutorials/how-to-install-webmin-on-ubuntu-20-04

iliajie commented 1 year ago

Try installing locale-related Perl dependencies:

apt-get install libdatetime-perl libdatetime-timezone-perl libdatetime-locale-perl libtime-piece-perl
Sopor commented 1 year ago

All the above Perl dependencies was already installed.

$ sudo apt install libdatetime-perl libdatetime-timezone-perl libdatetime-locale-perl libtime-piece-perl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'perl' instead of 'libtime-piece-perl'
libdatetime-locale-perl is already the newest version (1:1.33-1).
libdatetime-perl is already the newest version (2:1.55-1build1).
libdatetime-timezone-perl is already the newest version (1:2.51-1+2021e).
perl is already the newest version (5.34.0-3ubuntu1.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Sopor commented 1 year ago

I have now updated to Webmin 2.100 and it seems that you have removed the date format from Change Language and Theme and replaced it with Locale.

It seems that the hour now have two digits, but it will still show 12H and not 24H even after i changed Locale to Swedish.

The Language i use is still English.

image

iliajie commented 1 year ago

It seems that the hour now have two digits, but it will still show 12H and not 24H even after i changed Locale to Swedish.

Well, now I see the bug that's causing it. You can update theme to the latest development version from theme configuration page to have it fixed. Give it a try.

Sopor commented 1 year ago

I'm now running AT 21.02, but i still get 12H.

I tried to cleared the cache too, but no luck 😥

iliajie commented 1 year ago

I'm now running AT 21.02, but i still get 12H.

I'm pretty sure it should work! Try incognito tab to make sure that cache isn't in the way.

Also, make sure that you set the correct locale for the user. If it doesn't work, provide screenshots for locale select and the dashboard ..

Sopor commented 1 year ago

image

image

image

After changing Global locale to Swedish, it is working, but i did that in the Webmin language and locale image

And now it look like this in Change language and locale and I still have Personal choice enabled image

You can see below it is working now, but something isn't right because it will only work when i change Global locale language image

iliajie commented 1 year ago

You can see below it is working now, but something isn't right because it will only work when i change Global locale language

I'm pretty sure it also works with local locale settings too! At least it works for me in all tests.

Sopor commented 1 year ago

I did have some custom date/time before that you helped me to add, but it seems that you have removed it or should i say, i can't find it.

Could that be the reason it is not working now?

iliajie commented 1 year ago

Could you remind me what was that exactly?

Sopor commented 1 year ago

It must have been #667

iliajie commented 1 year ago

It must have been #667

Yeah, changing format for dates may have an effect.

Try running in the browser's console:

config_portable_theme_locale_format_full = 'LLLL';
config_portable_theme_locale_format_long = 'LL';
config_portable_theme_locale_format_short = 'L';
config_portable_theme_locale_format_time = 'LT';
theme.config.save();
Sopor commented 1 year ago

Now it got even worse.

Now it has changed to 12H or the dashboard too: image

I even tried to change it to Global locale and back again to Swedish, but it was still 12H.

I have cleared the cache and tried Private window, but it doesn't help. 😥

iliajie commented 1 year ago

I have cleared the cache and tried Private window, but it doesn't help. 😥

Is there a way I could remotely login to that system and have a look?

iliajie commented 1 year ago

By the way, the latest theme version is 21.03.

Sopor commented 1 year ago

No difference after update to 21.03

Sopor commented 1 year ago

I have three Webmin's and one of them don't have locale to choose from. Only date format.

Do you know why?

It is the same version of Webmin and AT as the other two: image

iliajie commented 1 year ago

Do you know why?

You need to install dependencies:

apt-get install libdatetime-perl libdatetime-timezone-perl libdatetime-locale-perl libtime-piece-perl
Sopor commented 1 year ago
0 upgraded, 37 newly installed, 0 to remove and 6 not upgraded.
Need to get 3,767 kB of archives.
After this operation, 28.6 MB of additional disk space will be used.

It seems that there was a lot of them missing 😁

Sopor commented 1 year ago

I wanted to see if all three Webmin's have the same behaviours and they do. They all show 12H when changing to Locale Sverige when i select that in the Personal choice. It will only work if i change the Global locale.

Sopor commented 1 year ago

Something that is a bit weird is, that even if i have selected Personal choice it will change to 24H when i change Global locale to Sverige:

image

image

iliajie commented 1 year ago

I'm glad it works for you. I have run more tests on Debian 12 with all the latest patches applied and it worked for me in both user-defined and global mode .. I am not sure what was happening on your side ..

Sopor commented 1 year ago

No, it is not working. I need to change the Global locale for it to work.

Why did you add Personal choice when it is not working?

iliajie commented 1 year ago

Why did you add Personal choice when it is not working?

~Sadly~ it works for me on all systems I tried/tested.

If you open browser console and run session.server.data('locale') .. what output do you get?

Sopor commented 1 year ago
15:18:07.873 session.server.data('locale')
15:18:07.897 "sv-SE"
iliajie commented 1 year ago

15:18:07.897 "sv-SE"

That just has to work then! I really don't know why it's not working for you .. Sorry .. Does this happen for you on all systems you tried? Is this Debian 11?

Sopor commented 1 year ago

If i change Global locale to English, but keep Personal choice to Sverige i get this:

15:19:56.028 session.server.data('locale')
15:19:56.047 "en" 
Sopor commented 1 year ago

Two are running Debian 11 and one is running Ubuntu Linux 22.04.2.

Sopor commented 1 year ago

Something i noticed in the cron job is that the time is showing 24H but the date is not correct: image

I have switched back to Global locale: English and Personal choice: Sverige

iliajie commented 1 year ago

Can you show the screenshot of configuration page, e.g. this is what I get with global set to English and local to Swedish:

image
Sopor commented 1 year ago

image

iliajie commented 1 year ago

What browser is this exactly, and which version and on which OS?

Sopor commented 1 year ago

I'm running Firefox 105.0.2 on Windows 10 22H2 x64, but i did a test in Chrome and it was no difference. 🙁

iliajie commented 1 year ago

Yet, it still works for me immaculately! I really don't understand what's happening on your side.

What is the out put of the following command on your system?

grep locale /etc/webmin/config
Sopor commented 1 year ago
$ grep locale /etc/webmin/config
locale=en
locale_root=sv-SE
iliajie commented 1 year ago

Do you have Use language specified by browser? enabled by any chance in Webmin ⇾ Webmin Configuration: Language and Locale page?

Sopor commented 1 year ago

image

iliajie commented 1 year ago

I'm sorry that I cannot help you with solving this issue! I don't know what's wrong. It simply works for me on literally all ten different machines I have tried.

Send me via email your /etc/webmin config directory. I will try to reproduce this issue using all your configs.

Sopor commented 1 year ago

Are you logged in as root or with a user that has sudo privileges?