diff --git a/modules/timeutil/timestamp.go b/modules/timeutil/timestamp.go index f70da9db747de..194d1d07e6a57 100644 --- a/modules/timeutil/timestamp.go +++ b/modules/timeutil/timestamp.go @@ -75,6 +75,11 @@ func (ts TimeStamp) FormatShort() string { return ts.Format("Jan 02, 2006") } +// FormatUTCDate formats as UTC date yyyy-mm-dd +func (ts TimeStamp) FormatUTCDate() string { + return time.Unix(int64(ts), 0).UTC().String()[:10] +} + // IsZero is zero time func (ts TimeStamp) IsZero() bool { return ts.AsTimeInLocation(time.Local).IsZero() diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index bcc69a48b86b7..d1e922bdf0b1b 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -28,7 +28,7 @@ {{range $.PullReviewers}} {{if eq .ReviewerID $ReviewerID }} - {{$notReviewed = false }} + {{$notReviewed = false }} {{if eq .Type 4 }} {{$checked = true}} {{if or (eq $ReviewerID $.SignedUserID) $.Permission.IsAdmin}} @@ -357,7 +357,7 @@ {{if ne .Issue.DeadlineUnix 0}} <p> {{svg "octicon-calendar" 16}} - {{.Issue.DeadlineUnix.FormatShort}} + {{.Issue.DeadlineUnix.FormatUTCDate}} {{if .Issue.IsOverdue}} <span style="color: red;">{{.i18n.Tr "repo.issues.due_date_overdue"}}</span> {{end}}