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

Use JS to convert timezones to local #15732

Closed
silverwind opened this issue May 5, 2021 · 5 comments
Closed

Use JS to convert timezones to local #15732

silverwind opened this issue May 5, 2021 · 5 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

@silverwind
Copy link
Member

The timestamp output in the UI is currently incorrectly using a single time zone set on the server so it will not show the correct dates for the user's current timezone. Instead, we should use something like https://github.com/github/time-elements to render dates in the user's local timezone. This features does require JS to work, otherwise it will display the server-rendered fallback date.

@silverwind silverwind added type/proposal The new feature has not been accepted yet but needs to be discussed first. topic/ui Change the appearance of the Gitea UI labels May 5, 2021
@zeripath
Copy link
Contributor

zeripath commented May 5, 2021

Agreed. Either the user has to pass down their current timezone or it has to be rendered on the client. The issue is the language translation.(which we're currently not doing correctly anyway.)

@silverwind
Copy link
Member Author

silverwind commented May 5, 2021

Yes, we can output a rendering in the server timezone as the placeholder value and as soon as JS loads, that's going to be replaced by a value for the actual user time zone.

Might want to extract the script that does that from the main JS bundle so the placeholder should only be there for a few milliseconds.

@yardenshoham
Copy link
Member

I believe this can be closed as the following PRs were merged:

@delvh delvh closed this as completed Oct 22, 2022
@yardenshoham
Copy link
Member

time-elements now supports locales (github/relative-time-element#174) so my previous PRs could be replaced

@silverwind
Copy link
Member Author

time-elements would definitely be preferred as they can auto-update relative time.

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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