Use readable timestamp for statuses
authorr <r@freesoftwareextremist.com>
Fri, 10 Jan 2020 04:05:01 +0000 (04:05 +0000)
committerr <r@freesoftwareextremist.com>
Fri, 10 Jan 2020 04:18:33 +0000 (04:18 +0000)
renderer/renderer.go
templates/status.tmpl

index efc412d616efc9f50d22a887d003b9f3bb520f83..406531260ea0f14273f809ebc69a643bd308e70a 100644 (file)
@@ -41,6 +41,7 @@ func NewRenderer(templateGlobPattern string) (r *renderer, err error) {
                "DisplayInteractionCount": DisplayInteractionCount,
                "TimeSince":               TimeSince,
                "FormatTimeRFC3339":       FormatTimeRFC3339,
+               "FormatTimeRFC822":        FormatTimeRFC822,
        }).ParseGlob(templateGlobPattern)
        if err != nil {
                return
@@ -175,3 +176,7 @@ func TimeSince(t time.Time) string {
 func FormatTimeRFC3339(t time.Time) string {
        return t.Format(time.RFC3339)
 }
+
+func FormatTimeRFC822(t time.Time) string {
+       return t.Format(time.RFC822)
+}
index 669fca840606f22c593226e4f1caacf88303c50b..24c318f75e53e0d0932e29c7205d3d5115059f9c 100644 (file)
                                </div>
                                <div class="status-action">
                                        <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>
                                </div>
                        </div>