Browse code

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 <github@gone.nl>

Sebastiaan van Stijn authored on 2016/07/02 09:55:52
Showing 1 changed files
... ...
@@ -16,7 +16,7 @@ import (
16 16
 )
17 17
 
18 18
 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"
20 20
 )
21 21
 
22 22
 type tasksBySlot []swarm.Task
... ...
@@ -69,7 +69,7 @@ func Print(dockerCli *client.DockerCli, ctx context.Context, tasks []swarm.Task,
69 69
 			serviceValue,
70 70
 			task.Spec.ContainerSpec.Image,
71 71
 			client.PrettyPrint(task.Status.State),
72
-			units.HumanDuration(time.Since(task.Status.Timestamp)),
72
+			strings.ToLower(units.HumanDuration(time.Since(task.Status.Timestamp))),
73 73
 			client.PrettyPrint(task.DesiredState),
74 74
 			nodeValue,
75 75
 		)