Skip to content

Commit

Permalink
Improve timestamp formatting
Browse files Browse the repository at this point in the history
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 <github@gone.nl>
  • Loading branch information
thaJeztah committed Jul 2, 2016
1 parent 212988d commit 04c94a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/client/task/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

const (
psTaskItemFmt = "%s\t%s\t%s\t%s\t%s %s\t%s\t%s\n"
psTaskItemFmt = "%s\t%s\t%s\t%s\t%s %s ago\t%s\t%s\n"
)

type tasksBySlot []swarm.Task
Expand Down Expand Up @@ -69,7 +69,7 @@ func Print(dockerCli *client.DockerCli, ctx context.Context, tasks []swarm.Task,
serviceValue,
task.Spec.ContainerSpec.Image,
client.PrettyPrint(task.Status.State),
units.HumanDuration(time.Since(task.Status.Timestamp)),
strings.ToLower(units.HumanDuration(time.Since(task.Status.Timestamp))),
client.PrettyPrint(task.DesiredState),
nodeValue,
)
Expand Down

0 comments on commit 04c94a0

Please sign in to comment.