-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[feature proposal] Local time zone in timestamps #6004
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
Labels
type/enhancement
An improvement of existing functionality
type/proposal
The new feature has not been accepted yet but needs to be discussed first.
Comments
In order to get rid of the "(Central European Standard Time)", i added a regex replace, ending up with localTime.toString().replace(/ *\([^)]*\) */g, "") which brings it all down to a more similar ui size as the original. |
A userscript to use with current version: // ==UserScript==
// @name Gitea local time
// @version 1
// @run-at document-end
// @include *
// ==/UserScript==
(function() {
/**
* @type {HTMLMetaElement}
*/
const meta = document.querySelector('meta[name=keywords]');
if (!(meta && meta.content.split(',').includes('gitea'))) {
return;
}
/**
* @type {NodeListOf<HTMLSpanElement>}
*/
const times = document.querySelectorAll('span.time-since.poping.up');
for (const i of times) {
const localTime = new Date(i.dataset.content);
if (isNaN(localTime)) {
continue;
}
i.dataset.content = localTime.toLocaleString();
}
})(); |
@NateScarlet could you send a PR to fix that? |
NateScarlet
added a commit
to NateScarlet/gitea
that referenced
this issue
Mar 14, 2019
Brilliant, nice addition @NateScarlet. And thanks for the help with a PR, I haven't been sure enough of my solution and the workflow to make one. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
type/enhancement
An improvement of existing functionality
type/proposal
The new feature has not been accepted yet but needs to be discussed first.
[x]
):Description
As a user, I would like to (at least have the option to) see timestamps presented in my local timezone. As several users can be located in different time zones, it would be a better experience to see timestamps presented in a way that corresponds to the local time.
My local solution to this is a short script that adjusts the stamp using the js Date-function placed in the footer:
though as I am not very experienced in javascript, a better solution is probably possible. Regardless of implementation, this is my proposal.
Screenshots
Current

Proposed

The text was updated successfully, but these errors were encountered: