Skip to content

Commit

Permalink
[core] use RFC3339 dates format
Browse files Browse the repository at this point in the history
  • Loading branch information
capcom6 committed Oct 30, 2024
1 parent 164587f commit 2164637
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion internal/commands/messages/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var send = &cli.Command{
&cli.TimestampFlag{
Name: "validUntil",
Usage: "Valid until",
Layout: time.DateTime,
Layout: time.RFC3339,
Timezone: time.Local,
},
},
Expand Down
32 changes: 16 additions & 16 deletions internal/core/output/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,6 @@ func (*TextOutput) MessageState(src smsgateway.MessageState) (string, error) {
builder.WriteString("\nIsEncrypted: ")
builder.WriteString(boolToString(src.IsEncrypted))

if len(src.States) > 0 {
builder.WriteString("\nStates: ")

for _, k := range messageStates {
v, ok := src.States[k]
if !ok {
continue
}

builder.WriteString("\n\t")
builder.WriteString(k)
builder.WriteString("\t")
builder.WriteString(v.Local().Format(time.DateTime))
}
}

builder.WriteString("\nRecipients: ")

for _, r := range src.Recipients {
Expand All @@ -64,5 +48,21 @@ func (*TextOutput) MessageState(src smsgateway.MessageState) (string, error) {
}
}

if len(src.States) > 0 {
builder.WriteString("\nStates: ")

for _, k := range messageStates {
v, ok := src.States[k]
if !ok {
continue
}

builder.WriteString("\n\t")
builder.WriteString(k)
builder.WriteString("\t")
builder.WriteString(v.Local().Format(time.RFC3339))
}
}

return builder.String(), nil
}

0 comments on commit 2164637

Please sign in to comment.