diff options
| author | 2025-03-02 11:27:30 +0100 | |
|---|---|---|
| committer | 2025-03-02 11:27:30 +0100 | |
| commit | 4c9901fc035ece13b2dbaca21465a534abb77a04 (patch) | |
| tree | 4aad111cdd492fa908fd9a6c0ab1d27e7f8ddf06 /internal/router/template.go | |
| parent | [feature] add microformat support (#3848) (diff) | |
| download | gotosocial-4c9901fc035ece13b2dbaca21465a534abb77a04.tar.xz | |
[chore] little frontend tweaks (#3852)
* [chore] little frontend tweaks
* beep boop
* poke
* clarify server time
Diffstat (limited to 'internal/router/template.go')
| -rw-r--r-- | internal/router/template.go | 25 |
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 { |
