mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-22 15:25:19 +00:00
string formatted timestamp for chats
This commit is contained in:
@@ -106,9 +106,9 @@ func TestListMessages(t *testing.T) {
|
||||
// sortMessages by the time they were sent
|
||||
func sortMessages(msgs []*pb.Message) {
|
||||
sort.Slice(msgs, func(i, j int) bool {
|
||||
if msgs[i].SentAt == 0 || msgs[j].SentAt == 0 {
|
||||
if len(msgs[i].SentAt) == 0 || len(msgs[j].SentAt) == 0 {
|
||||
return true
|
||||
}
|
||||
return msgs[i].SentAt < msgs[j].SentAt
|
||||
return handler.ParseTime(msgs[i].SentAt).Before(handler.ParseTime(msgs[j].SentAt))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user