mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 06:14:22 +01:00
print timezone on some dates.
This commit is contained in:
12
utils.go
12
utils.go
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user