MCPcopy Create free account
hub / github.com/github/gh-aw / findDailyBetweenSeparator

Method findDailyBetweenSeparator

pkg/parser/schedule_parser.go:387–401  ·  view source on GitHub ↗
(hasWeekdaysSuffix bool)

Source from the content-addressed store, hash-verified

385}
386
387func (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
403func (p *ScheduleParser) parseDailyAround(hasWeekdaysSuffix bool) (string, error) {
404 timeStr, err := p.extractTimeWithWeekdays(2, hasWeekdaysSuffix)

Callers 1

parseDailyBetweenMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected