summaryrefslogtreecommitdiff
path: root/internal/router/template.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/router/template.go')
-rw-r--r--internal/router/template.go25
1 files changed, 0 insertions, 25 deletions
diff --git a/internal/router/template.go b/internal/router/template.go
index 981c3fcf4..70d87add1 100644
--- a/internal/router/template.go
+++ b/internal/router/template.go
@@ -26,7 +26,6 @@ import (
"reflect"
"regexp"
"strings"
- "time"
"unsafe"
"github.com/gin-gonic/gin"
@@ -128,7 +127,6 @@ var funcMap = template.FuncMap{
"oddOrEven": oddOrEven,
"subtract": subtract,
"timestampPrecise": timestampPrecise,
- "timestamp": timestamp,
"timestampVague": timestampVague,
"visibilityIcon": visibilityIcon,
}
@@ -174,29 +172,6 @@ const (
badTimestamp = "bad timestamp"
)
-func timestamp(stamp string) string {
- t, err := util.ParseISO8601(stamp)
- if err != nil {
- log.Errorf(nil, "error parsing timestamp %s: %s", stamp, err)
- return badTimestamp
- }
-
- t = t.Local()
-
- tYear, tMonth, tDay := t.Date()
- now := time.Now()
- currentYear, currentMonth, currentDay := now.Date()
-
- switch {
- case tYear == currentYear && tMonth == currentMonth && tDay == currentDay:
- return "Today, " + t.Format(justTime)
- case tYear == currentYear:
- return t.Format(dateTime)
- default:
- return t.Format(dateYear)
- }
-}
-
func timestampPrecise(stamp string) string {
t, err := util.ParseISO8601(stamp)
if err != nil {