From 0b83cc21be4b53de401e9c3ffca74ae3f003e55e Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 25 Jan 2022 05:48:56 +0000 Subject: [PATCH] Fix commit's time (#18375) (#18392) - Backport of #18375 --- templates/repo/commits_list.tmpl | 6 +++++- templates/repo/view_list.tmpl | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index d43170e525cc6..85bfe9ab4f64a 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -75,7 +75,11 @@ {{end}} - {{TimeSince .Author.When $.Lang}} + {{if .Committer}} + {{TimeSince .Committer.When $.Lang}} + {{else}} + {{TimeSince .Author.When $.Lang}} + {{end}} {{end}} diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index d490220694750..7c76d8787520a 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -34,7 +34,7 @@ {{end}} - {{if .LatestCommit}}{{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}{{end}} + {{if .LatestCommit}}{{if .LatestCommit.Committer}}{{TimeSince .LatestCommit.Committer.When $.Lang}}{{end}}{{end}}