@@ -114,7 +114,7 @@ func timeSincePro(then, now time.Time, lang translation.Locale) string {
114
114
return strings .TrimPrefix (timeStr , ", " )
115
115
}
116
116
117
- func timeSinceUnix (then , now time.Time , lang translation.Locale , attrsMap ... map [ string ] any ) template.HTML {
117
+ func timeSinceUnix (then , now time.Time , lang translation.Locale ) template.HTML {
118
118
friendlyText := then .Format ("2006-01-02 15:04:05 +07:00" )
119
119
120
120
// document: https://github.com/github/relative-time-element
@@ -124,30 +124,18 @@ func timeSinceUnix(then, now time.Time, lang translation.Locale, attrsMap ...map
124
124
attrs = `tense="future"`
125
125
}
126
126
127
- transOnDate := ""
128
- if len (attrsMap ) == 1 {
129
- m := attrsMap [0 ]
130
- if m ["tense" ] == "auto" {
131
- attrs = `tense="auto"` // "relative-time" doesn't support i18n of "prefix", so we use our translation
132
- transOnDate = lang .Tr ("tool.on_date" )
133
- }
134
- }
135
-
136
127
// declare data-tooltip-content attribute to switch from "title" tooltip to "tippy" tooltip
137
128
htm := fmt .Sprintf (`<relative-time class="time-since" prefix="" %s datetime="%s" data-tooltip-content data-tooltip-interactive="true">%s</relative-time>` ,
138
129
attrs , then .Format (time .RFC3339 ), friendlyText )
139
- if transOnDate != "" {
140
- htm = fmt .Sprintf (transOnDate , htm )
141
- }
142
130
return template .HTML (htm )
143
131
}
144
132
145
133
// TimeSince renders relative time HTML given a time.Time
146
- func TimeSince (then time.Time , lang translation.Locale , attrs ... map [ string ] any ) template.HTML {
147
- return timeSinceUnix (then , time .Now (), lang , attrs ... )
134
+ func TimeSince (then time.Time , lang translation.Locale ) template.HTML {
135
+ return timeSinceUnix (then , time .Now (), lang )
148
136
}
149
137
150
138
// TimeSinceUnix renders relative time HTML given a TimeStamp
151
- func TimeSinceUnix (then TimeStamp , lang translation.Locale , extra ... map [ string ] any ) template.HTML {
152
- return TimeSince (then .AsLocalTime (), lang , extra ... )
139
+ func TimeSinceUnix (then TimeStamp , lang translation.Locale ) template.HTML {
140
+ return TimeSince (then .AsLocalTime (), lang )
153
141
}
0 commit comments