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

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

Closed
Sopor opened this issue Jul 17, 2023 · 52 comments
Closed

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

Sopor opened this issue Jul 17, 2023 · 52 comments

Comments

@Sopor
Copy link
Contributor

Sopor commented Jul 17, 2023

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?

webmin pushed a commit to webmin/webmin that referenced this issue Jul 18, 2023
@jcameron
Copy link
Collaborator

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

@Sopor
Copy link
Contributor Author

Sopor commented Jul 21, 2023

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
Copy link
Collaborator

iliajie commented Jul 21, 2023

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
Copy link
Contributor Author

Sopor commented Jul 21, 2023

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

I use global dates format.

@iliajie
Copy link
Collaborator

iliajie commented Jul 21, 2023

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

@Sopor
Copy link
Contributor Author

Sopor commented Jul 21, 2023

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
Copy link
Contributor Author

Sopor commented Jul 21, 2023

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
Copy link
Collaborator

iliajie commented Jul 21, 2023

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
Copy link
Contributor Author

Sopor commented Jul 21, 2023

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
Copy link
Collaborator

iliajie commented Jul 21, 2023

OS?

@Sopor
Copy link
Contributor Author

Sopor commented Jul 21, 2023

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
Copy link
Collaborator

iliajie commented Jul 21, 2023

Try installing locale-related Perl dependencies:

apt-get install libdatetime-perl libdatetime-timezone-perl libdatetime-locale-perl libtime-piece-perl

@Sopor
Copy link
Contributor Author

Sopor commented Jul 24, 2023

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
Copy link
Contributor Author

Sopor commented Jul 24, 2023

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 added a commit that referenced this issue Jul 24, 2023
@iliajie
Copy link
Collaborator

iliajie commented Jul 24, 2023

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
Copy link
Contributor Author

Sopor commented Jul 29, 2023

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

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

@iliajie
Copy link
Collaborator

iliajie commented Jul 29, 2023

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
Copy link
Contributor Author

Sopor commented Jul 30, 2023

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
Copy link
Collaborator

iliajie commented Jul 31, 2023

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
Copy link
Contributor Author

Sopor commented Jul 31, 2023

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
Copy link
Collaborator

iliajie commented Jul 31, 2023

Could you remind me what was that exactly?

@Sopor
Copy link
Contributor Author

Sopor commented Jul 31, 2023

It must have been #667

@iliajie
Copy link
Collaborator

iliajie commented Aug 1, 2023

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
Copy link
Contributor Author

Sopor commented Aug 1, 2023

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
Copy link
Collaborator

iliajie commented Aug 1, 2023

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
Copy link
Collaborator

iliajie commented Aug 1, 2023

By the way, the latest theme version is 21.03.

@Sopor
Copy link
Contributor Author

Sopor commented Aug 1, 2023

No difference after update to 21.03

@Sopor
Copy link
Contributor Author

Sopor commented Aug 1, 2023

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
Copy link
Collaborator

iliajie commented Aug 1, 2023

Do you know why?

You need to install dependencies:

apt-get install libdatetime-perl libdatetime-timezone-perl libdatetime-locale-perl libtime-piece-perl

@Sopor
Copy link
Contributor Author

Sopor commented Aug 1, 2023

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
Copy link
Contributor Author

Sopor commented Aug 1, 2023

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
Copy link
Contributor Author

Sopor commented Aug 1, 2023

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
Copy link
Collaborator

iliajie commented Aug 1, 2023

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
Copy link
Contributor Author

Sopor commented Aug 1, 2023

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
Copy link
Collaborator

iliajie commented Aug 1, 2023

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
Copy link
Contributor Author

Sopor commented Aug 1, 2023

15:18:07.873 session.server.data('locale')
15:18:07.897 "sv-SE"

@iliajie
Copy link
Collaborator

iliajie commented Aug 1, 2023

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
Copy link
Contributor Author

Sopor commented Aug 1, 2023

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
Copy link
Contributor Author

Sopor commented Aug 1, 2023

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

@Sopor
Copy link
Contributor Author

Sopor commented Aug 1, 2023

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
Copy link
Collaborator

iliajie commented Aug 1, 2023

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
Copy link
Contributor Author

Sopor commented Aug 1, 2023

image

@iliajie
Copy link
Collaborator

iliajie commented Aug 1, 2023

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

@Sopor
Copy link
Contributor Author

Sopor commented Aug 1, 2023

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
Copy link
Collaborator

iliajie commented Aug 2, 2023

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

@iliajie iliajie reopened this Aug 2, 2023
@Sopor
Copy link
Contributor Author

Sopor commented Aug 2, 2023

$ grep locale /etc/webmin/config
locale=en
locale_root=sv-SE

@iliajie
Copy link
Collaborator

iliajie commented Aug 3, 2023

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

@Sopor
Copy link
Contributor Author

Sopor commented Aug 3, 2023

image

@iliajie
Copy link
Collaborator

iliajie commented Aug 3, 2023

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
Copy link
Contributor Author

Sopor commented Aug 3, 2023

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

@iliajie
Copy link
Collaborator

iliajie commented Aug 3, 2023

Alright, now I see the bug!

Discussion related to this issue is also here webmin/webmin@407ce7e.

@iliajie
Copy link
Collaborator

iliajie commented Aug 4, 2023

@Sopor This bug was fixed in the latest Webmin nightly version.

Although, @jcameron I'm surprised that root-capable user cannot have its own specific theme, language and locale set. It doesn't seem right. I'm not sure why this is like this, as it doesn't seem hard to implement. I was going to do it now but decided that it would be better to postpone it. Should I add this to my todo to the next Webmin release (after 2.101)?

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

No branches or pull requests

3 participants