{"record":{"id":"d4e0a8fc13c3ad65","repo":"nexu-io/open-design","slug":"schedule-weekly-requires-day-hh-mm-tz-day-is","errorCode":null,"errorMessage":"--schedule weekly requires :DAY:HH:MM[:TZ] (DAY is 0-6 or sun/mon/...)","messagePattern":"--schedule weekly requires :DAY:HH:MM\\[:TZ\\] \\(DAY is 0-6 or sun/mon/\\.\\.\\.\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/cli.ts","lineNumber":10520,"sourceCode":"    }\n    return { kind: 'hourly', minute };\n  }\n  if (kind === 'daily' || kind === 'weekdays') {\n    if (parts.length < 3) {\n      throw new Error(`--schedule ${kind} requires :HH:MM[:TZ]`);\n    }\n    const hh = parts[1];\n    const mm = parts[2];\n    const time = `${hh.padStart(2, '0')}:${mm.padStart(2, '0')}`;\n    if (!/^[0-2]\\d:[0-5]\\d$/.test(time)) {\n      throw new Error(`--schedule ${kind} time must be HH:MM (24h)`);\n    }\n    const timezone = parts.slice(3).join(':') || 'UTC';\n    return { kind, time, timezone };\n  }\n  if (kind === 'weekly') {\n    if (parts.length < 4) {\n      throw new Error('--schedule weekly requires :DAY:HH:MM[:TZ] (DAY is 0-6 or sun/mon/...)');\n    }\n    const dayToken = String(parts[1]).toLowerCase();\n    let weekday;\n    if (/^[0-6]$/.test(dayToken)) {\n      weekday = Number(dayToken);\n    } else if (AUTOMATION_WEEKDAY_TOKENS[dayToken] !== undefined) {\n      weekday = AUTOMATION_WEEKDAY_TOKENS[dayToken];\n    } else {\n      throw new Error(`--schedule weekly day must be 0-6 or sun..sat (got \"${parts[1]}\")`);\n    }\n    const time = `${parts[2].padStart(2, '0')}:${parts[3].padStart(2, '0')}`;\n    if (!/^[0-2]\\d:[0-5]\\d$/.test(time)) {\n      throw new Error('--schedule weekly time must be HH:MM (24h)');\n    }\n    const timezone = parts.slice(4).join(':') || 'UTC';\n    return { kind: 'weekly', weekday, time, timezone };\n  }\n  throw new Error(`--schedule kind must be hourly|daily|weekdays|weekly (got \"${kind}\")`);","sourceCodeStart":10502,"sourceCodeEnd":10538,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/cli.ts#L10502-L10538","documentation":"Thrown by parseScheduleFlag when a `--schedule weekly:...` flag has fewer than four colon-separated parts. Weekly requires the full shape `weekly:DAY:HH:MM[:TZ]`, so kind + day + hour + minute is the minimum. The parser splits on `:` and checks `parts.length < 4`.","triggerScenarios":"Running `od automation create --schedule weekly:mon` (only day), `--schedule weekly:mon:09` (day + hour, missing minute), or `--schedule weekly` alone.","commonSituations":"Forgetting that weekly needs both a day and a full time, or assuming it inherits a default time like the daily form does.","solutions":["Supply the full form `weekly:<day>:<HH>:<MM>`, e.g. `--schedule weekly:mon:09:30`.","Optionally add a timezone as a 5th segment: `weekly:mon:09:30:Europe/London`.","If you only need a daily cadence, switch to `--schedule daily:HH:MM` instead."],"exampleFix":"// before\n--schedule weekly:mon:09\n// after\n--schedule weekly:mon:09:30","handlingStrategy":"validation","validationCode":"// Ensure a weekly schedule has at least kind:DAY:HH:MM before parsing.\nfunction weeklyHasEnoughParts(raw: string): boolean {\n  return raw.split(':').length >= 4;\n}","typeGuard":null,"tryCatchPattern":"try {\n  parseScheduleFlag(raw);\n} catch (err) {\n  if (err instanceof Error && /weekly requires :DAY:HH:MM/.test(err.message)) {\n    // prompt user for the full weekly form\n  }\n  throw err;\n}","preventionTips":["Remember the weekly shape is kind:DAY:HH:MM[:TZ] — four colon segments minimum.","Use the daily/weekdays form if you do not actually need a specific weekday."],"tags":["cli","validation","automation","schedule","flag-parsing"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}