Skip to content

[feature proposal] Local time zone in timestamps #6004

Closed
@oscarlofwenhamn

Description

@oscarlofwenhamn
  • Gitea version (or commit ref): 1.7.1
  • Git version: n/a
  • Operating system: RHEL 7.5
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist: n/a

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:

window.onload=function(){
    var times = document.getElementsByClassName("time-since");
    for (var i = 0; i<times.length; i++){
		var localTime = new Date(times[i].getAttribute("data-content"));
		if(localTime != "Invalid Date"){
			times[i].setAttribute("data-content", localTime.toString());
		}
    }
}

though as I am not very experienced in javascript, a better solution is probably possible. Regardless of implementation, this is my proposal.

Screenshots

Current
image

Proposed
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementAn improvement of existing functionalitytype/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions