mirror of
https://git.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-22 20:11:29 +00:00
Use readable timestamp for statuses
This commit is contained in:
parent
cb56c459c5
commit
fb20bdc65e
|
@ -41,6 +41,7 @@ func NewRenderer(templateGlobPattern string) (r *renderer, err error) {
|
||||||
"DisplayInteractionCount": DisplayInteractionCount,
|
"DisplayInteractionCount": DisplayInteractionCount,
|
||||||
"TimeSince": TimeSince,
|
"TimeSince": TimeSince,
|
||||||
"FormatTimeRFC3339": FormatTimeRFC3339,
|
"FormatTimeRFC3339": FormatTimeRFC3339,
|
||||||
|
"FormatTimeRFC822": FormatTimeRFC822,
|
||||||
}).ParseGlob(templateGlobPattern)
|
}).ParseGlob(templateGlobPattern)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
@ -175,3 +176,7 @@ func TimeSince(t time.Time) string {
|
||||||
func FormatTimeRFC3339(t time.Time) string {
|
func FormatTimeRFC3339(t time.Time) string {
|
||||||
return t.Format(time.RFC3339)
|
return t.Format(time.RFC3339)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func FormatTimeRFC822(t time.Time) string {
|
||||||
|
return t.Format(time.RFC822)
|
||||||
|
}
|
||||||
|
|
|
@ -134,7 +134,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="status-action">
|
<div class="status-action">
|
||||||
<a class="status-time" href="/thread/{{.ID}}#status-{{.ID}}" {{if .ThreadInNewTab}}target="_blank"{{end}}>
|
<a class="status-time" href="/thread/{{.ID}}#status-{{.ID}}" {{if .ThreadInNewTab}}target="_blank"{{end}}>
|
||||||
<time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{.CreatedAt}}"> {{TimeSince .CreatedAt}} </time>
|
<time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}"> {{TimeSince .CreatedAt}} </time>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue