TimeRange parses a Schedule from a cron specification interpreted as a continuous time range. For example, the expression "* 9-18 * * 1-5" represents a continuous time span from 09:00:00 to 18:59:59, Monday through Friday. The specification consists of space-delimited fields in the following order
(raw string)
| 87 | // Unlike standard cron, this function interprets the input as a continuous active period |
| 88 | // rather than discrete scheduled times. |
| 89 | func TimeRange(raw string) (*Schedule, error) { |
| 90 | if err := validateTimeRangeSpec(raw); err != nil { |
| 91 | return nil, xerrors.Errorf("validate time range schedule: %w", err) |
| 92 | } |
| 93 | |
| 94 | return parse(raw) |
| 95 | } |
| 96 | |
| 97 | func parse(raw string) (*Schedule, error) { |
| 98 | // If schedule does not specify a timezone, default to UTC. Otherwise, |
no test coverage detected