+44
-27
appview/pages/funcmap.go
+44
-27
appview/pages/funcmap.go
···
105
105
s = append(s, values...)
106
106
return s
107
107
},
108
-
"timeFmt": humanize.Time,
109
-
"longTimeFmt": func(t time.Time) string {
110
-
return t.Format("2006-01-02 * 3:04 PM")
111
-
},
112
-
"commaFmt": humanize.Comma,
113
-
"shortTimeFmt": func(t time.Time) string {
108
+
"commaFmt": humanize.Comma,
109
+
"relTimeFmt": humanize.Time,
110
+
"shortRelTimeFmt": func(t time.Time) string {
114
111
return humanize.CustomRelTime(t, time.Now(), "", "", []humanize.RelTimeMagnitude{
115
112
{time.Second, "now", time.Second},
116
113
{2 * time.Second, "1s %s", 1},
···
129
126
{math.MaxInt64, "a long while %s", 1},
130
127
})
131
128
},
132
-
"durationFmt": func(duration time.Duration) string {
129
+
"longTimeFmt": func(t time.Time) string {
130
+
return t.Format("Jan 2, 2006, 3:04 PM MST")
131
+
},
132
+
"iso8601DateTimeFmt": func(t time.Time) string {
133
+
return t.Format("2006-01-02T15:04:05-07:00")
134
+
},
135
+
"iso8601DurationFmt": func(duration time.Duration) string {
133
136
days := int64(duration.Hours() / 24)
134
137
hours := int64(math.Mod(duration.Hours(), 24))
135
138
minutes := int64(math.Mod(duration.Minutes(), 60))
136
139
seconds := int64(math.Mod(duration.Seconds(), 60))
137
-
138
-
chunks := []struct {
139
-
name string
140
-
amount int64
141
-
}{
142
-
{"d", days},
143
-
{"hr", hours},
144
-
{"min", minutes},
145
-
{"s", seconds},
146
-
}
147
-
148
-
parts := []string{}
149
-
150
-
for _, chunk := range chunks {
151
-
if chunk.amount != 0 {
152
-
parts = append(parts, fmt.Sprintf("%d%s", chunk.amount, chunk.name))
153
-
}
154
-
}
155
-
156
-
return strings.Join(parts, " ")
140
+
return fmt.Sprintf("P%dD%dH%dM%dS", days, hours, minutes, seconds)
141
+
},
142
+
"durationFmt": func(duration time.Duration) string {
143
+
return durationFmt(duration, [4]string{"d", "hr", "min", "s"})
144
+
},
145
+
"longDurationFmt": func(duration time.Duration) string {
146
+
return durationFmt(duration, [4]string{"days", "hours", "minutes", "seconds"})
157
147
},
158
148
"byteFmt": humanize.Bytes,
159
149
"length": func(slice any) int {
···
288
278
modifiedSVG := svgStr[:svgTagEnd] + classTag + svgStr[svgTagEnd:]
289
279
return template.HTML(modifiedSVG), nil
290
280
}
281
+
282
+
func durationFmt(duration time.Duration, names [4]string) string {
283
+
days := int64(duration.Hours() / 24)
284
+
hours := int64(math.Mod(duration.Hours(), 24))
285
+
minutes := int64(math.Mod(duration.Minutes(), 60))
286
+
seconds := int64(math.Mod(duration.Seconds(), 60))
287
+
288
+
chunks := []struct {
289
+
name string
290
+
amount int64
291
+
}{
292
+
{names[0], days},
293
+
{names[1], hours},
294
+
{names[2], minutes},
295
+
{names[3], seconds},
296
+
}
297
+
298
+
parts := []string{}
299
+
300
+
for _, chunk := range chunks {
301
+
if chunk.amount != 0 {
302
+
parts = append(parts, fmt.Sprintf("%d%s", chunk.amount, chunk.name))
303
+
}
304
+
}
305
+
306
+
return strings.Join(parts, " ")
307
+
}
+2
-2
appview/pages/templates/knot.html
+2
-2
appview/pages/templates/knot.html
···
26
26
</dd>
27
27
28
28
<dt class="font-bold">opened</dt>
29
-
<dd>{{ .Registration.Created | timeFmt }}</dd>
29
+
<dd>{{ template "repo/fragments/time" .Registration.Created }}</dd>
30
30
31
31
{{ if .Registration.Registered }}
32
32
<dt class="font-bold">registered</dt>
33
-
<dd>{{ .Registration.Registered | timeFmt }}</dd>
33
+
<dd>{{ template "repo/fragments/time" .Registration.Registered }}</dd>
34
34
{{ else }}
35
35
<dt class="font-bold">status</dt>
36
36
<dd class="text-yellow-800 dark:text-yellow-200 bg-yellow-100 dark:bg-yellow-900 rounded px-2 py-1 inline-block">
+2
-2
appview/pages/templates/knots.html
+2
-2
appview/pages/templates/knots.html
···
44
44
</a>
45
45
</div>
46
46
<p class="text-sm text-gray-500 dark:text-gray-400">owned by {{ .ByDid }}</p>
47
-
<p class="text-sm text-gray-500 dark:text-gray-400">registered {{ .Registered | timeFmt }}</p>
47
+
<p class="text-sm text-gray-500 dark:text-gray-400">registered {{ template "repo/fragments/time" .Registered }}</p>
48
48
</div>
49
49
</div>
50
50
{{ end }}
···
70
70
</div>
71
71
</div>
72
72
<p class="text-sm text-gray-500 dark:text-gray-400">opened by {{ .ByDid }}</p>
73
-
<p class="text-sm text-gray-500 dark:text-gray-400">created {{ .Created | timeFmt }}</p>
73
+
<p class="text-sm text-gray-500 dark:text-gray-400">created {{ template "repo/fragments/time" .Created }}</p>
74
74
</div>
75
75
<div class="flex gap-2 items-center">
76
76
<button
+2
-2
appview/pages/templates/repo/branches.html
+2
-2
appview/pages/templates/repo/branches.html
···
59
59
</td>
60
60
<td class="py-3 whitespace-nowrap text-gray-500 dark:text-gray-400">
61
61
{{ if .Commit }}
62
-
{{ .Commit.Committer.When | timeFmt }}
62
+
{{ template "repo/fragments/time" .Commit.Committer.When }}
63
63
{{ end }}
64
64
</td>
65
65
</tr>
···
98
98
</a>
99
99
</span>
100
100
<div class="inline-block px-1 select-none after:content-['ยท']"></div>
101
-
<span>{{ .Commit.Committer.When | timeFmt }}</span>
101
+
{{ template "repo/fragments/time" .Commit.Committer.When }}
102
102
</div>
103
103
{{ end }}
104
104
</div>
+1
-1
appview/pages/templates/repo/commit.html
+1
-1
appview/pages/templates/repo/commit.html
···
34
34
<a href="mailto:{{ $commit.Author.Email }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ $commit.Author.Name }}</a>
35
35
{{ end }}
36
36
<span class="px-1 select-none before:content-['\00B7']"></span>
37
-
{{ timeFmt $commit.Author.When }}
37
+
{{ template "repo/fragments/time" $commit.Author.When }}
38
38
<span class="px-1 select-none before:content-['\00B7']"></span>
39
39
</p>
40
40
+1
-1
appview/pages/templates/repo/compare/new.html
+1
-1
appview/pages/templates/repo/compare/new.html
···
19
19
<a href="/{{ $.RepoInfo.FullName }}/compare?head={{ $br.Name | urlquery }}" class="no-underline hover:no-underline">
20
20
<div class="flex items-center justify-between p-2">
21
21
{{ $br.Name }}
22
-
<time class="text-gray-500 dark:text-gray-400">{{ timeFmt $br.Commit.Committer.When }}</time>
22
+
<span class="text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" $br.Commit.Committer.When }}</span>
23
23
</div>
24
24
</a>
25
25
{{ end }}
+1
-1
appview/pages/templates/repo/empty.html
+1
-1
appview/pages/templates/repo/empty.html
···
17
17
<a href="/{{ $.RepoInfo.FullName }}/tree/{{$br.Name | urlquery }}" class="no-underline hover:no-underline">
18
18
<div class="flex items-center justify-between p-2">
19
19
{{ $br.Name }}
20
-
<time class="text-gray-500 dark:text-gray-400">{{ timeFmt $br.Commit.Committer.When }}</time>
20
+
<span class="text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" $br.Commit.Committer.When }}</span>
21
21
</div>
22
22
</a>
23
23
{{ end }}
+2
-2
appview/pages/templates/repo/fragments/artifact.html
+2
-2
appview/pages/templates/repo/fragments/artifact.html
···
10
10
</div>
11
11
12
12
<div id="right-side" class="text-gray-500 dark:text-gray-400 flex items-center flex-shrink-0 gap-2 text-sm">
13
-
<span title="{{ longTimeFmt .Artifact.CreatedAt }}" class="hidden md:inline">{{ timeFmt .Artifact.CreatedAt }}</span>
14
-
<span title="{{ longTimeFmt .Artifact.CreatedAt }}" class=" md:hidden">{{ shortTimeFmt .Artifact.CreatedAt }}</span>
13
+
<span class="hidden md:inline">{{ template "repo/fragments/time" .Artifact.CreatedAt }}</span>
14
+
<span class=" md:hidden">{{ template "repo/fragments/shortTime" .Artifact.CreatedAt }}</span>
15
15
16
16
<span class="select-none after:content-['ยท'] hidden md:inline"></span>
17
17
<span class="truncate max-w-[100px] hidden md:inline">{{ .Artifact.MimeType }}</span>
+19
appview/pages/templates/repo/fragments/time.html
+19
appview/pages/templates/repo/fragments/time.html
···
1
+
{{ define "repo/fragments/timeWrapper" }}
2
+
<time datetime="{{ .Time | iso8601DateTimeFmt }}" title="{{ .Time | longTimeFmt }}">{{ .Content }}</time>
3
+
{{ end }}
4
+
5
+
{{ define "repo/fragments/time" }}
6
+
{{ template "repo/fragments/timeWrapper" (dict "Time" . "Content" (. | relTimeFmt)) }}
7
+
{{ end }}
8
+
9
+
{{ define "repo/fragments/shortTime" }}
10
+
{{ template "repo/fragments/timeWrapper" (dict "Time" . "Content" (. | shortRelTimeFmt)) }}
11
+
{{ end }}
12
+
13
+
{{ define "repo/fragments/shortTimeAgo" }}
14
+
{{ template "repo/fragments/timeWrapper" (dict "Time" . "Content" (print (. | shortRelTimeFmt) " ago")) }}
15
+
{{ end }}
16
+
17
+
{{ define "repo/fragments/duration" }}
18
+
<time datetime="{{ . | iso8601DurationFmt }}" title="{{ . | longDurationFmt }}">{{ . | durationFmt }}</time>
19
+
{{ end }}
+5
-9
appview/pages/templates/repo/index.html
+5
-9
appview/pages/templates/repo/index.html
···
149
149
</a>
150
150
151
151
{{ if .LastCommit }}
152
-
<time class="text-xs text-gray-500 dark:text-gray-400"
153
-
>{{ timeFmt .LastCommit.When }}</time
154
-
>
152
+
<span class="text-xs text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .LastCommit.When }}</span>
155
153
{{ end }}
156
154
</div>
157
155
</div>
···
172
170
</a>
173
171
174
172
{{ if .LastCommit }}
175
-
<time class="text-xs text-gray-500 dark:text-gray-400"
176
-
>{{ timeFmt .LastCommit.When }}</time
177
-
>
173
+
<span class="text-xs text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .LastCommit.When }}</span>
178
174
{{ end }}
179
175
</div>
180
176
</div>
···
273
269
>
274
270
</span>
275
271
<div class="inline-block px-1 select-none after:content-['ยท']"></div>
276
-
<span>{{ timeFmt .Committer.When }}</span>
272
+
{{ template "repo/fragments/time" .Committer.When }}
277
273
278
274
<!-- tags/branches -->
279
275
{{ $tagsForCommit := index $.TagMap .Hash.String }}
···
320
316
</a>
321
317
{{ if .Commit }}
322
318
<span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['ยท']"></span>
323
-
<time class="text-xs text-gray-500 dark:text-gray-400">{{ timeFmt .Commit.Committer.When }}</time>
319
+
<span class="text-xs text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .Commit.Committer.When }}</span>
324
320
{{ end }}
325
321
{{ if .IsDefault }}
326
322
<span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['ยท']"></span>
···
366
362
</div>
367
363
<div>
368
364
{{ with .Tag }}
369
-
<time class="text-xs text-gray-500 dark:text-gray-400">{{ timeFmt .Tagger.When }}</time>
365
+
<span class="text-xs text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .Tagger.When }}</span>
370
366
{{ end }}
371
367
{{ if eq $idx 0 }}
372
368
{{ with .Tag }}<span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['ยท']"></span>{{ end }}
+1
-1
appview/pages/templates/repo/issues/fragments/editIssueComment.html
+1
-1
appview/pages/templates/repo/issues/fragments/editIssueComment.html
+3
-3
appview/pages/templates/repo/issues/fragments/issueComment.html
+3
-3
appview/pages/templates/repo/issues/fragments/issueComment.html
···
11
11
class="text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-400 hover:underline no-underline"
12
12
id="{{ .CommentId }}">
13
13
{{ if .Deleted }}
14
-
deleted {{ .Deleted | timeFmt }}
14
+
deleted {{ template "repo/fragments/time" .Deleted }}
15
15
{{ else if .Edited }}
16
-
edited {{ .Edited | timeFmt }}
16
+
edited {{ template "repo/fragments/time" .Edited }}
17
17
{{ else }}
18
-
{{ .Created | timeFmt }}
18
+
{{ template "repo/fragments/time" .Created }}
19
19
{{ end }}
20
20
</a>
21
21
+1
-3
appview/pages/templates/repo/issues/issue.html
+1
-3
appview/pages/templates/repo/issues/issue.html
···
35
35
{{ $owner := didOrHandle .Issue.OwnerDid .IssueOwnerHandle }}
36
36
{{ template "user/fragments/picHandleLink" $owner }}
37
37
<span class="select-none before:content-['\00B7']"></span>
38
-
<time title="{{ .Issue.Created | longTimeFmt }}">
39
-
{{ .Issue.Created | timeFmt }}
40
-
</time>
38
+
{{ template "repo/fragments/time" .Issue.Created }}
41
39
</span>
42
40
</div>
43
41
+1
-3
appview/pages/templates/repo/issues/issues.html
+1
-3
appview/pages/templates/repo/issues/issues.html
+2
-2
appview/pages/templates/repo/log.html
+2
-2
appview/pages/templates/repo/log.html
···
87
87
{{ template "repo/pipelines/fragments/pipelineSymbolLong" (dict "Pipeline" $pipeline "RepoInfo" $.RepoInfo) }}
88
88
{{ end }}
89
89
</td>
90
-
<td class=" py-3 align-top text-gray-500 dark:text-gray-400">{{ timeFmt $commit.Committer.When }}</td>
90
+
<td class=" py-3 align-top text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" $commit.Committer.When }}</td>
91
91
</tr>
92
92
{{ end }}
93
93
</tbody>
···
163
163
</a>
164
164
</span>
165
165
<div class="inline-block px-1 select-none after:content-['ยท']"></div>
166
-
<span>{{ shortTimeFmt $commit.Committer.When }}</span>
166
+
<span>{{ template "repo/fragments/shortTime" $commit.Committer.When }}</span>
167
167
168
168
<!-- ci status -->
169
169
{{ $pipeline := index $.Pipelines .Hash.String }}
+5
-9
appview/pages/templates/repo/pipelines/fragments/tooltip.html
+5
-9
appview/pages/templates/repo/pipelines/fragments/tooltip.html
···
10
10
{{ $lastStatus := $all.Latest }}
11
11
{{ $kind := $lastStatus.Status.String }}
12
12
13
-
{{ $t := .TimeTaken }}
14
-
{{ $time := "" }}
15
-
{{ if $t }}
16
-
{{ $time = durationFmt $t }}
17
-
{{ else }}
18
-
{{ $time = printf "%s ago" (shortTimeFmt $pipeline.Created) }}
19
-
{{ end }}
20
-
21
13
<div id="left" class="flex items-center gap-2 flex-shrink-0">
22
14
{{ template "repo/pipelines/fragments/workflowSymbol" $all }}
23
15
{{ $name }}
24
16
</div>
25
17
<div id="right" class="flex items-center gap-2 flex-shrink-0">
26
18
<span class="font-bold">{{ $kind }}</span>
27
-
<time>{{ $time }}</time>
19
+
{{ if .TimeTaken }}
20
+
{{ template "repo/fragments/duration" .TimeTaken }}
21
+
{{ else }}
22
+
{{ template "repo/fragments/shortTimeAgo" $pipeline.Created }}
23
+
{{ end }}
28
24
</div>
29
25
</div>
30
26
</a>
+1
-3
appview/pages/templates/repo/pipelines/pipelines.html
+1
-3
appview/pages/templates/repo/pipelines/pipelines.html
+5
-10
appview/pages/templates/repo/pipelines/workflow.html
+5
-10
appview/pages/templates/repo/pipelines/workflow.html
···
32
32
{{ $lastStatus := $all.Latest }}
33
33
{{ $kind := $lastStatus.Status.String }}
34
34
35
-
{{ $t := .TimeTaken }}
36
-
{{ $time := "" }}
37
-
38
-
{{ if $t }}
39
-
{{ $time = durationFmt $t }}
40
-
{{ else }}
41
-
{{ $time = printf "%s ago" (shortTimeFmt $lastStatus.Created) }}
42
-
{{ end }}
43
-
44
35
<div id="left" class="flex items-center gap-2 flex-shrink-0">
45
36
{{ template "repo/pipelines/fragments/workflowSymbol" $all }}
46
37
{{ $name }}
47
38
</div>
48
39
<div id="right" class="flex items-center gap-2 flex-shrink-0">
49
40
<span class="font-bold">{{ $kind }}</span>
50
-
<time>{{ $time }}</time>
41
+
{{ if .TimeTaken }}
42
+
{{ template "repo/fragments/duration" .TimeTaken }}
43
+
{{ else }}
44
+
{{ template "repo/fragments/shortTimeAgo" $lastStatus.Created }}
45
+
{{ end }}
51
46
</div>
52
47
</div>
53
48
</a>
+1
-1
appview/pages/templates/repo/pulls/fragments/pullHeader.html
+1
-1
appview/pages/templates/repo/pulls/fragments/pullHeader.html
···
31
31
{{ $owner := index $.DidHandleMap .Pull.OwnerDid }}
32
32
{{ template "user/fragments/picHandleLink" $owner }}
33
33
<span class="select-none before:content-['\00B7']"></span>
34
-
<time>{{ .Pull.Created | timeFmt }}</time>
34
+
{{ template "repo/fragments/time" .Pull.Created }}
35
35
36
36
<span class="select-none before:content-['\00B7']"></span>
37
37
<span>
+7
-12
appview/pages/templates/repo/pulls/pull.html
+7
-12
appview/pages/templates/repo/pulls/pull.html
···
55
55
<span class="hidden md:inline">{{$re}}submitted</span>
56
56
by {{ template "user/fragments/picHandleLink" $owner }}
57
57
<span class="select-none before:content-['\00B7']"></span>
58
-
<a class="text-gray-500 dark:text-gray-400 hover:text-gray-500" href="#round-#{{ .RoundNumber }}"><time>{{ .Created | shortTimeFmt }}</time></a>
58
+
<a class="text-gray-500 dark:text-gray-400 hover:text-gray-500" href="#round-#{{ .RoundNumber }}">{{ template "repo/fragments/shortTime" .Created }}</a>
59
59
<span class="select-none before:content-['ยท']"></span>
60
60
{{ $s := "s" }}
61
61
{{ if eq (len .Comments) 1 }}
···
154
154
{{ $owner := index $.DidHandleMap $c.OwnerDid }}
155
155
{{ template "user/fragments/picHandleLink" $owner }}
156
156
<span class="before:content-['ยท']"></span>
157
-
<a class="text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-300" href="#comment-{{.ID}}"><time>{{ $c.Created | shortTimeFmt }}</time></a>
157
+
<a class="text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-300" href="#comment-{{.ID}}">{{ template "repo/fragments/time" $c.Created }}</a>
158
158
</div>
159
159
<div class="prose dark:prose-invert">
160
160
{{ $c.Body | markdown }}
···
277
277
{{ $lastStatus := $all.Latest }}
278
278
{{ $kind := $lastStatus.Status.String }}
279
279
280
-
{{ $t := .TimeTaken }}
281
-
{{ $time := "" }}
282
-
283
-
{{ if $t }}
284
-
{{ $time = durationFmt $t }}
285
-
{{ else }}
286
-
{{ $time = printf "%s ago" (shortTimeFmt $lastStatus.Created) }}
287
-
{{ end }}
288
-
289
280
<div id="left" class="flex items-center gap-2 flex-shrink-0">
290
281
{{ template "repo/pipelines/fragments/workflowSymbol" $all }}
291
282
{{ $name }}
292
283
</div>
293
284
<div id="right" class="flex items-center gap-2 flex-shrink-0">
294
285
<span class="font-bold">{{ $kind }}</span>
295
-
<time>{{ $time }}</time>
286
+
{{ if .TimeTaken }}
287
+
{{ template "repo/fragments/duration" .TimeTaken }}
288
+
{{ else }}
289
+
{{ template "repo/fragments/shortTimeAgo" $lastStatus.Created }}
290
+
{{ end }}
296
291
</div>
297
292
</div>
298
293
</a>
+2
-4
appview/pages/templates/repo/pulls/pulls.html
+2
-4
appview/pages/templates/repo/pulls/pulls.html
···
79
79
{{ template "user/fragments/picHandleLink" $owner }}
80
80
</span>
81
81
82
-
<span>
83
-
<time>
84
-
{{ .Created | timeFmt }}
85
-
</time>
82
+
<span class="before:content-['ยท']">
83
+
{{ template "repo/fragments/time" .Created }}
86
84
</span>
87
85
88
86
<span class="before:content-['ยท']">
+2
-2
appview/pages/templates/repo/tree.html
+2
-2
appview/pages/templates/repo/tree.html
···
65
65
{{ if .LastCommit}}
66
66
<div class="flex items-end gap-2">
67
67
<span class="text text-gray-500 dark:text-gray-400 mr-6">{{ .LastCommit.Message }}</span>
68
-
<time class="text-xs text-gray-500 dark:text-gray-400">{{ timeFmt .LastCommit.When }}</time>
68
+
<span class="text-xs text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .LastCommit.When }}</span>
69
69
</div>
70
70
{{ end }}
71
71
</div>
···
85
85
{{ if .LastCommit}}
86
86
<div class="flex items-end gap-2">
87
87
<span class="text text-gray-500 dark:text-gray-400 mr-6">{{ .LastCommit.Message }}</span>
88
-
<time class="text-xs text-gray-500 dark:text-gray-400">{{ timeFmt .LastCommit.When }}</time>
88
+
<span class="text-xs text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .LastCommit.When }}</span>
89
89
</div>
90
90
{{ end }}
91
91
</div>
+2
-2
appview/pages/templates/settings.html
+2
-2
appview/pages/templates/settings.html
···
39
39
{{ i "key" "w-3 h-3 dark:text-gray-300" }}
40
40
<p class="font-bold dark:text-white">{{ .Name }}</p>
41
41
</div>
42
-
<p class="text-sm text-gray-500 dark:text-gray-400">added {{ .Created | timeFmt }}</p>
42
+
<p class="text-sm text-gray-500 dark:text-gray-400">added {{ template "repo/fragments/time" .Created }}</p>
43
43
<div class="overflow-x-auto whitespace-nowrap flex-1 max-w-full">
44
44
<code class="text-sm text-gray-500 dark:text-gray-400">{{ .Key }}</code>
45
45
</div>
···
112
112
{{ end }}
113
113
</div>
114
114
</div>
115
-
<p class="text-sm text-gray-500 dark:text-gray-400">added {{ .CreatedAt | timeFmt }}</p>
115
+
<p class="text-sm text-gray-500 dark:text-gray-400">added {{ template "repo/fragments/time" .CreatedAt }}</p>
116
116
</div>
117
117
<div class="flex gap-2 items-center">
118
118
{{ if not .Verified }}
+2
-2
appview/pages/templates/spindles/fragments/spindleListing.html
+2
-2
appview/pages/templates/spindles/fragments/spindleListing.html
···
11
11
{{ i "hard-drive" "w-4 h-4" }}
12
12
{{ .Instance }}
13
13
<span class="text-gray-500">
14
-
{{ .Created | shortTimeFmt }} ago
14
+
{{ template "repo/fragments/shortTimeAgo" .Created }}
15
15
</span>
16
16
</a>
17
17
{{ else }}
···
19
19
{{ i "hard-drive" "w-4 h-4" }}
20
20
{{ .Instance }}
21
21
<span class="text-gray-500">
22
-
{{ .Created | shortTimeFmt }} ago
22
+
{{ template "repo/fragments/shortTimeAgo" .Created }}
23
23
</span>
24
24
</div>
25
25
{{ end }}
+6
-6
appview/pages/templates/timeline.html
+6
-6
appview/pages/templates/timeline.html
···
84
84
>{{ .Repo.Name }}</a
85
85
>
86
86
{{ end }}
87
-
<time
87
+
<span
88
88
class="text-gray-700 dark:text-gray-400 text-xs"
89
-
>{{ .Repo.Created | timeFmt }}</time
89
+
>{{ template "repo/fragments/time" .Repo.Created }}</span
90
90
>
91
91
</p>
92
92
</div>
···
98
98
{{ template "user/fragments/picHandleLink" $userHandle }}
99
99
followed
100
100
{{ template "user/fragments/picHandleLink" $subjectHandle }}
101
-
<time
101
+
<span
102
102
class="text-gray-700 dark:text-gray-400 text-xs"
103
-
>{{ .Follow.FollowedAt | timeFmt }}</time
103
+
>{{ template "repo/fragments/time" .Follow.FollowedAt }}</span
104
104
>
105
105
</p>
106
106
</div>
···
116
116
class="no-underline hover:underline"
117
117
>{{ $repoOwnerHandle | truncateAt30 }}/{{ .Star.Repo.Name }}</a
118
118
>
119
-
<time
119
+
<span
120
120
class="text-gray-700 dark:text-gray-400 text-xs"
121
-
>{{ .Star.Created | timeFmt }}</time
121
+
>{{ template "repo/fragments/time" .Star.Created }}</spa
122
122
>
123
123
</p>
124
124
</div>