relative relativizes a duration with the prefix "ago" or "in"
(d time.Duration)
| 90 | |
| 91 | // relative relativizes a duration with the prefix "ago" or "in" |
| 92 | func 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] |
| 103 | func parseCLISchedule(parts ...string) (*cron.Schedule, error) { |