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

Date format #33096

Open
chascode opened this issue Jan 3, 2025 · 8 comments
Open

Date format #33096

chascode opened this issue Jan 3, 2025 · 8 comments
Labels
topic/ui Change the appearance of the Gitea UI type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@chascode
Copy link

chascode commented Jan 3, 2025

Feature Description

I request that a date format setting be added instead of guessing by the user's chosen language. If not possible, I request additional variants of English.

The following screenshot shows Dec 13, 2024 instead of the desired 13 Dec 2024.

screenshot

Screenshots

No response

@chascode chascode added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Jan 3, 2025
@eeyrjmr
Copy link
Contributor

eeyrjmr commented Jan 3, 2025

related issue #29651

@techknowlogick techknowlogick added the topic/ui Change the appearance of the Gitea UI label Jan 4, 2025
@wxiaoguang
Copy link
Contributor

Could you change your system's date format? Then it should work as you set.

@wxiaoguang wxiaoguang added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Jan 4, 2025
@chascode
Copy link
Author

chascode commented Jan 4, 2025

Thanks for the reply.

I'm on Debian Bookworm and my system's date format is already set as desired.

$ locale
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

My browser, Firefox, also displays the correct date format. Tested with (javascript):

currentDate.toLocaleString();

I'm proxying gitea with apache. When I add the following to my virtual host the date format is displayed as desired:

    AddOutputFilterByType sed text/html
    OutputSed "2s/<html lang=\"en-US\"/<html lang=\"en-GB\"/"

...but that's a workaround and forces all users of my instance to use my desired date format.

@wxiaoguang wxiaoguang removed the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Jan 4, 2025
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jan 4, 2025

I see the problem .... I guess we shouldn't set <html lang="en-US" header ....

@wxiaoguang
Copy link
Contributor

Could you try if <html lang="en" works for you? If yes, I could propose a quick fix.

@chascode
Copy link
Author

chascode commented Jan 4, 2025

Unfortunately, <html lang="en" displays the date wrong in both Firefox and Chrome.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jan 4, 2025

Hmm, maybe we need more tricks to make it work. For example: when user uses en-GB and the language uses English (en-US), then emit "lang=en-GB"

@chascode
Copy link
Author

chascode commented Jan 4, 2025

That should work for 99% of cases (assuming other variants, like, en-AU) but I'm not overly convinced that language and date format should be the same locale setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/ui Change the appearance of the Gitea UI type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

4 participants