MCPcopy Index your code
hub / github.com/coder/coder / relative

Function relative

cli/util.go:92–100  ·  view source on GitHub ↗

relative relativizes a duration with the prefix "ago" or "in"

(d time.Duration)

Source from the content-addressed store, hash-verified

90
91// relative relativizes a duration with the prefix "ago" or "in"
92func relative(d time.Duration) string {
93 if d > 0 {
94 return "in " + durationDisplay(d)
95 }
96 if d < 0 {
97 return durationDisplay(d) + " ago"
98 }
99 return "now"
100}
101
102// parseCLISchedule parses a schedule in the format HH:MM{AM|PM} [DOW] [LOCATION]
103func parseCLISchedule(parts ...string) (*cron.Schedule, error) {

Callers 2

TestRelativeFunction · 0.85
collectFilesFunction · 0.85

Calls 1

durationDisplayFunction · 0.85

Tested by 1

TestRelativeFunction · 0.68