Skip to content

Commit 04c94a0

Browse files
committed
Improve timestamp formatting
lowercase the output, to prevent "About" halfway, and add "ago" to the output, as timestamps are always in the past. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 212988d commit 04c94a0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

api/client/task/print.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
)
1717

1818
const (
19-
psTaskItemFmt = "%s\t%s\t%s\t%s\t%s %s\t%s\t%s\n"
19+
psTaskItemFmt = "%s\t%s\t%s\t%s\t%s %s ago\t%s\t%s\n"
2020
)
2121

2222
type tasksBySlot []swarm.Task
@@ -69,7 +69,7 @@ func Print(dockerCli *client.DockerCli, ctx context.Context, tasks []swarm.Task,
6969
serviceValue,
7070
task.Spec.ContainerSpec.Image,
7171
client.PrettyPrint(task.Status.State),
72-
units.HumanDuration(time.Since(task.Status.Timestamp)),
72+
strings.ToLower(units.HumanDuration(time.Since(task.Status.Timestamp))),
7373
client.PrettyPrint(task.DesiredState),
7474
nodeValue,
7575
)

0 commit comments

Comments
 (0)