print timezone on some dates.

This commit is contained in:
fiatjaf
2024-10-12 09:10:16 -03:00
parent f55da46b54
commit 45c19052d0
3 changed files with 2 additions and 14 deletions

View File

@@ -409,18 +409,6 @@ func limitAt[V any](list []V, n int) []V {
return list[0:n]
}
func humanDate(createdAt nostr.Timestamp) string {
ts := createdAt.Time()
now := time.Now()
if ts.Before(now.AddDate(0, -9, 0)) {
return ts.UTC().Format("02 Jan 2006")
} else if ts.Before(now.AddDate(0, 0, -6)) {
return ts.UTC().Format("Jan _2")
} else {
return ts.UTC().Format("Mon, Jan _2 15:04 UTC")
}
}
func maxIndex(slice []int) int {
maxIndex := -1
maxVal := 0