From b068dbd40ee3b4dc7d18cdcf168f0c24cea234c0 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 4 Nov 2024 19:30:00 +0800 Subject: Refactor DateUtils and merge TimeSince (#32409) Follow #32383 and #32402 --- templates/package/view.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'templates/package/view.tmpl') diff --git a/templates/package/view.tmpl b/templates/package/view.tmpl index d104788483..0f06d7afbd 100644 --- a/templates/package/view.tmpl +++ b/templates/package/view.tmpl @@ -8,7 +8,7 @@

{{.PackageDescriptor.Package.Name}} ({{.PackageDescriptor.Version.Version}})

- {{$timeStr := TimeSinceUnix .PackageDescriptor.Version.CreatedUnix ctx.Locale}} + {{$timeStr := DateUtils.TimeSince .PackageDescriptor.Version.CreatedUnix}} {{if .HasRepositoryAccess}} {{ctx.Locale.Tr "packages.published_by_in" $timeStr .PackageDescriptor.Creator.HomeLink .PackageDescriptor.Creator.GetDisplayName .PackageDescriptor.Repository.Link .PackageDescriptor.Repository.FullName}} {{else}} @@ -47,7 +47,7 @@ {{if .HasRepositoryAccess}}
{{svg "octicon-repo" 16 "tw-mr-2"}} {{.PackageDescriptor.Repository.FullName}}
{{end}} -
{{svg "octicon-calendar" 16 "tw-mr-2"}} {{TimeSinceUnix .PackageDescriptor.Version.CreatedUnix ctx.Locale}}
+
{{svg "octicon-calendar" 16 "tw-mr-2"}} {{DateUtils.TimeSince .PackageDescriptor.Version.CreatedUnix}}
{{svg "octicon-download" 16 "tw-mr-2"}} {{.PackageDescriptor.Version.DownloadCount}}
{{template "package/metadata/alpine" .}} {{template "package/metadata/cargo" .}} @@ -92,7 +92,7 @@ {{range .LatestVersions}}
{{.Version}} - {{ctx.DateUtils.AbsoluteShort .CreatedUnix}} + {{DateUtils.AbsoluteShort .CreatedUnix}}
{{end}}
-- cgit v1.2.3