Skip to content

Commit 3f1e489

Browse files
Remove the time-since class (#29826)
It serves no purpose. --------- Signed-off-by: Yarden Shoham <[email protected]> Co-authored-by: Giteabot <[email protected]>
1 parent 3979970 commit 3f1e489

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

modules/timeutil/datetime.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313

1414
// DateTime renders an absolute time HTML element by datetime.
1515
func DateTime(format string, datetime any, extraAttrs ...string) template.HTML {
16+
// TODO: remove the extraAttrs argument, it's not used in any call to DateTime
17+
1618
if p, ok := datetime.(*time.Time); ok {
1719
datetime = *p
1820
}

modules/timeutil/since.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ func timeSinceUnix(then, now time.Time, _ translation.Locale) template.HTML {
126126
}
127127

128128
// declare data-tooltip-content attribute to switch from "title" tooltip to "tippy" tooltip
129-
htm := fmt.Sprintf(`<relative-time class="time-since" prefix="" %s datetime="%s" data-tooltip-content data-tooltip-interactive="true">%s</relative-time>`,
129+
htm := fmt.Sprintf(`<relative-time prefix="" %s datetime="%s" data-tooltip-content data-tooltip-interactive="true">%s</relative-time>`,
130130
attrs, then.Format(time.RFC3339), friendlyText)
131131
return template.HTML(htm)
132132
}
133133

134134
// TimeSince renders relative time HTML given a time.Time
135135
func TimeSince(then time.Time, lang translation.Locale) template.HTML {
136136
if setting.UI.PreferredTimestampTense == "absolute" {
137-
return DateTime("full", then, `class="time-since"`)
137+
return DateTime("full", then)
138138
}
139139
return timeSinceUnix(then, time.Now(), lang)
140140
}

tests/integration/repo_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func testViewRepo(t *testing.T) {
7777
})
7878

7979
// convert "2017-06-14 21:54:21 +0800" to "Wed, 14 Jun 2017 13:54:21 UTC"
80-
htmlTimeString, _ := s.Find("relative-time.time-since").Attr("datetime")
80+
htmlTimeString, _ := s.Find("relative-time").Attr("datetime")
8181
htmlTime, _ := time.Parse(time.RFC3339, htmlTimeString)
8282
f.commitTime = htmlTime.In(time.Local).Format(time.RFC1123)
8383
items = append(items, f)

web_src/js/components/DiffCommitSelector.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ export default {
248248
{{ commit.committer_or_author_name }}
249249
<span class="text right">
250250
<!-- TODO: make this respect the PreferredTimestampTense setting -->
251-
<relative-time class="time-since" prefix="" :datetime="commit.time" data-tooltip-content data-tooltip-interactive="true">{{ commit.time }}</relative-time>
251+
<relative-time prefix="" :datetime="commit.time" data-tooltip-content data-tooltip-interactive="true">{{ commit.time }}</relative-time>
252252
</span>
253253
</div>
254254
</div>

0 commit comments

Comments
 (0)