all repos — elgit @ 06ee92e3d0cefe07a83bf4e93bb73bf5ae7bc108

fork of legit: web frontend for git, written in go

show commit time in log as a human-readable, relative time

Alan Pearce
commit

06ee92e3d0cefe07a83bf4e93bb73bf5ae7bc108

parent

edbc1a7ebeb920119f4c094bde4382bacadf851a

1 file changed, 2 insertions(+), 1 deletion(-)

jump to
M templates/commit.gotemplates/commit.go
@@ -5,6 +5,7 @@ "fmt"
"time" "github.com/bluekeyes/go-gitdiff/gitdiff" + "github.com/dustin/go-humanize" "github.com/go-git/go-git/v5/plumbing/object" "go.alanpearce.eu/elgit/git" g "go.alanpearce.eu/gomponents"
@@ -119,7 +120,7 @@ ),
Div( Time( DateTime(author.When.Format(time.RFC3339)), - g.Text(author.When.Format("Mon, 02 Jan 2006 15:04:05 -0700")), + g.Text(humanize.Time(author.When)), ), ), )