-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Allow to select 24h time format #28371
Comments
You mean the dates displayed on the web interface? We are using https://github.com/github/relative-time-element#relative-time-element and it does not seem to have an option for 24h format, so likely it would need to be contributed there first. |
@silverwind Problem is <html lang="en-US" class="theme-auto"> When this would be |
Hmm maybe a "en-GB" locale could be added as an alias to "en-US". I don't see us maintaining separate translations for it, too little gain. |
I completely agree that 24-hour time format should be available. It's especially important in technical environments where correctness is required. I'd go further and say ISO 8601 (YYYY-MM-DD hh:mm:ss) should be available as the entire date and time string, regardless of UI language, which seems available in some conditions in the web UI I haven't been able to pin down yet. |
I think there is a start for supporting this: Add global setting how timestamps should be rendered #28657
More improvements could be done based on that approach (if there could be found more). ps: it is only a instance-wide config, not a user-level config ..... |
I agree with this. It looks like a great way to implement it.
That's fine by me. I'd do it server-wide, anyway. |
I don't like a instance-wide setting, it forces the admin's preference onto users, it's disrespectful to users. There are way to detect 24h preference in JS. Also
So maybe it's already supported and you just need to fix your OS/browser locale settings? |
Oh it really depends on your Gitea language, with English I also get 12h format |
I found the fix, PR incoming... |
Fixes: #28371 Fixed by using a JS solution that formats according to `lang`, but alters the 24h format setting as per user's locale. This will work for all tooltips: <img width="243" alt="Screenshot 2024-03-07 at 23 03 35" src="https://github.com/go-gitea/gitea/assets/115237/6d16c71c-6786-4eda-8cdc-50ec68ba62c6"> <img width="250" alt="Screenshot 2024-03-07 at 23 03 17" src="https://github.com/go-gitea/gitea/assets/115237/4e26bbb7-12df-4b81-bd37-14705e87e8f7"> <img width="310" alt="Screenshot 2024-03-07 at 23 14 34" src="https://github.com/go-gitea/gitea/assets/115237/1ef599f0-6401-4e19-b1da-59cdfc09b0f6"> I think there is only one other place in the UI where we render such absolute dates, which is in the actions view and which I've also fixed: <img width="275" alt="Screenshot 2024-03-07 at 23 04 00" src="https://github.com/go-gitea/gitea/assets/115237/df0fbe1f-96ee-4338-ab5e-2b10e215005d">
Some people like instance-wide enforcement, and there are good reasons for it, such as standards compliance which is very important, such as ISO 8601 in this case. It's still a choice, either way. We currently don't have a choice at all. Well, at least until #29651 . |
Locale settings can be forced to users if you control their browser or OS and that will work for many websites not just gitea. |
Fixes: go-gitea/gitea#28371 Fixed by using a JS solution that formats according to `lang`, but alters the 24h format setting as per user's locale. This will work for all tooltips: <img width="243" alt="Screenshot 2024-03-07 at 23 03 35" src="https://github.com/go-gitea/gitea/assets/115237/6d16c71c-6786-4eda-8cdc-50ec68ba62c6"> <img width="250" alt="Screenshot 2024-03-07 at 23 03 17" src="https://github.com/go-gitea/gitea/assets/115237/4e26bbb7-12df-4b81-bd37-14705e87e8f7"> <img width="310" alt="Screenshot 2024-03-07 at 23 14 34" src="https://github.com/go-gitea/gitea/assets/115237/1ef599f0-6401-4e19-b1da-59cdfc09b0f6"> I think there is only one other place in the UI where we render such absolute dates, which is in the actions view and which I've also fixed: <img width="275" alt="Screenshot 2024-03-07 at 23 04 00" src="https://github.com/go-gitea/gitea/assets/115237/df0fbe1f-96ee-4338-ab5e-2b10e215005d"> (cherry picked from commit f86e9a03673b70d660a4b7a1e53748757d7a45fa)
Feature Description
gitea seems already to support the 24h time format but it appears that this is bound to the language settings.
Please add either
Time format and interface language are usually two different things. E.g. I prefer english language for technical content but 12h time format is completely unreadable for me.
Screenshots
No response
The text was updated successfully, but these errors were encountered: