mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore] little frontend tweaks (#3852)
* [chore] little frontend tweaks * beep boop * poke * clarify server time
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user