| 385 | } |
| 386 | |
| 387 | func (p *ScheduleParser) findDailyBetweenSeparator(hasWeekdaysSuffix bool) (int, error) { |
| 388 | if len(p.tokens) < 5 { |
| 389 | return -1, errors.New("invalid 'between' format, expected 'daily between START and END'") |
| 390 | } |
| 391 | endPos := len(p.tokens) |
| 392 | if hasWeekdaysSuffix { |
| 393 | endPos -= 2 |
| 394 | } |
| 395 | for i := 2; i < endPos; i++ { |
| 396 | if p.tokens[i] == "and" { |
| 397 | return i, nil |
| 398 | } |
| 399 | } |
| 400 | return -1, errors.New("missing 'and' keyword in 'between' clause") |
| 401 | } |
| 402 | |
| 403 | func (p *ScheduleParser) parseDailyAround(hasWeekdaysSuffix bool) (string, error) { |
| 404 | timeStr, err := p.extractTimeWithWeekdays(2, hasWeekdaysSuffix) |