(hasWeekdaysSuffix bool)
| 171 | } |
| 172 | |
| 173 | func (p *ScheduleParser) parseEveryDayIntervalAlias(hasWeekdaysSuffix bool) (string, bool, error) { |
| 174 | if p.tokens[1] != "day" && p.tokens[1] != "days" { |
| 175 | return "", false, nil |
| 176 | } |
| 177 | if len(p.tokens) == 2 || (len(p.tokens) == 4 && hasWeekdaysSuffix) { |
| 178 | if hasWeekdaysSuffix { |
| 179 | return "FUZZY:DAILY_WEEKDAYS * * *", true, nil |
| 180 | } |
| 181 | return "FUZZY:DAILY * * *", true, nil |
| 182 | } |
| 183 | if len(p.tokens) > 2 && p.tokens[2] == "at" { |
| 184 | timeStr, err := p.extractTime(2) |
| 185 | if err != nil { |
| 186 | return "", true, err |
| 187 | } |
| 188 | minute, hour := parseTime(timeStr) |
| 189 | if hasWeekdaysSuffix { |
| 190 | return fmt.Sprintf("%s %s * * 1-5", minute, hour), true, nil |
| 191 | } |
| 192 | return fmt.Sprintf("%s %s * * *", minute, hour), true, nil |
| 193 | } |
| 194 | return "", true, errors.New("invalid 'every day' format, use 'every day' or 'every day at HH:MM'") |
| 195 | } |
| 196 | |
| 197 | func (p *ScheduleParser) parseLongInterval(hasWeekdaysSuffix bool) (string, error) { |
| 198 | if len(p.tokens) < p.minimumIntervalTokenCount(hasWeekdaysSuffix) { |
no test coverage detected