@@ -257,14 +257,15 @@ func GetJobs(client *api.Client, repo ghrepo.Interface, run Run) ([]Job, error)
257257
258258func PromptForRun (cs * iostreams.ColorScheme , runs []Run ) (string , error ) {
259259 var selected int
260+ now := time .Now ()
260261
261262 candidates := []string {}
262263
263264 for _ , run := range runs {
264265 symbol , _ := Symbol (cs , run .Status , run .Conclusion )
265266 candidates = append (candidates ,
266267 // TODO truncate commit message, long ones look terrible
267- fmt .Sprintf ("%s %s, %s (%s)" , symbol , run .CommitMsg (), run .Name , run .HeadBranch ))
268+ fmt .Sprintf ("%s %s, %s (%s) %s " , symbol , run .CommitMsg (), run .Name , run .HeadBranch , preciseAgo ( now , run . CreatedAt ) ))
268269 }
269270
270271 // TODO consider custom filter so it's fuzzier. right now matches start anywhere in string but
@@ -380,3 +381,14 @@ func PullRequestForRun(client *api.Client, repo ghrepo.Interface, run Run) (int,
380381
381382 return number , nil
382383}
384+
385+ func preciseAgo (now time.Time , createdAt time.Time ) string {
386+ ago := now .Sub (createdAt )
387+
388+ if ago < 30 * 24 * time .Hour {
389+ s := ago .Truncate (time .Second ).String ()
390+ return fmt .Sprintf ("%s ago" , s )
391+ }
392+
393+ return createdAt .Format ("Jan _2, 2006" )
394+ }
0 commit comments