[chore] little frontend tweaks (#3852)

* [chore] little frontend tweaks

* beep boop

* poke

* clarify server time
This commit is contained in:
tobi
2025-03-02 11:27:30 +01:00
committed by GitHub
parent e78e817057
commit 4c9901fc03
6 changed files with 18 additions and 44 deletions

View File

@@ -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 {