MCPcopy Create free account
hub / github.com/Facets-cloud/flow / parseOwnerWhen

Function parseOwnerWhen

internal/app/owner.go:339–348  ·  view source on GitHub ↗

parseOwnerWhen accepts an RFC3339 timestamp or a date expression (YYYY-MM-DD, today, tomorrow, weekday, Nd) for `flow owner next --at`.

(s string)

Source from the content-addressed store, hash-verified

337// parseOwnerWhen accepts an RFC3339 timestamp or a date expression
338// (YYYY-MM-DD, today, tomorrow, weekday, Nd) for `flow owner next --at`.
339func parseOwnerWhen(s string) (time.Time, error) {
340 if t, err := time.Parse(time.RFC3339, s); err == nil {
341 return t, nil
342 }
343 d, err := parseDueDate(s, time.Now())
344 if err != nil {
345 return time.Time{}, fmt.Errorf("not an RFC3339 time or a recognizable date: %w", err)
346 }
347 return d, nil
348}
349
350// ownerStart marks an owner active and schedules its first tick now, so
351// the next scheduler pass picks it up. Then it ticks every Every.

Callers 1

ownerNextFunction · 0.85

Calls 1

parseDueDateFunction · 0.85

Tested by

no test coverage detected