6
1
mirror of https://git.mills.io/saltyim/saltyim.git synced 2024-06-30 18:51:03 +00:00

Improve display of date/time

This commit is contained in:
James Mills 2022-03-19 14:10:56 +10:00
parent 53c7bd5cad
commit eefeb944e7

@ -15,6 +15,10 @@ import (
"go.mills.io/saltyim"
)
const (
dateTimeFormat = "2006-01-02 15:04:05"
)
var readCmd = &cobra.Command{
Use: "read [<inbox>]",
Short: "Reads messages from an inbox",
@ -59,7 +63,7 @@ func formatMsg(msg string) string {
return fmt.Sprintf(
"%s\t%s\t%s",
aurora.Sprintf(aurora.Blue(st.Timestamp.DateTime().Local().String())),
aurora.Sprintf(aurora.Blue(st.Timestamp.DateTime().Local().Format(dateTimeFormat))),
aurora.Sprintf(aurora.Index(userColor, st.User.String())),
st.LiteralText(),
)