nexu-io/open-design · error · Error

--schedule weekly time must be HH:MM (24h)

Error message

--schedule weekly time must be HH:MM (24h)

What it means

Thrown by parseScheduleFlag for a weekly schedule when the HH:MM portion (parts[2]:parts[3]) fails the same 24h regex `/^[0-2]\d:[0-5]\d$/` as the daily/weekdays check. The day token has already been validated by the time this runs, so the day is fine and only the time is wrong.

Source

Thrown at apps/daemon/src/cli.ts:10533

    const timezone = parts.slice(3).join(':') || 'UTC';
    return { kind, time, timezone };
  }
  if (kind === 'weekly') {
    if (parts.length < 4) {
      throw new Error('--schedule weekly requires :DAY:HH:MM[:TZ] (DAY is 0-6 or sun/mon/...)');
    }
    const dayToken = String(parts[1]).toLowerCase();
    let weekday;
    if (/^[0-6]$/.test(dayToken)) {
      weekday = Number(dayToken);
    } else if (AUTOMATION_WEEKDAY_TOKENS[dayToken] !== undefined) {
      weekday = AUTOMATION_WEEKDAY_TOKENS[dayToken];
    } else {
      throw new Error(`--schedule weekly day must be 0-6 or sun..sat (got "${parts[1]}")`);
    }
    const time = `${parts[2].padStart(2, '0')}:${parts[3].padStart(2, '0')}`;
    if (!/^[0-2]\d:[0-5]\d$/.test(time)) {
      throw new Error('--schedule weekly time must be HH:MM (24h)');
    }
    const timezone = parts.slice(4).join(':') || 'UTC';
    return { kind: 'weekly', weekday, time, timezone };
  }
  throw new Error(`--schedule kind must be hourly|daily|weekdays|weekly (got "${kind}")`);
}

function parseAutomationTarget(flags) {
  const raw = flags.target;
  if (raw == null) {
    if (flags.project) return { mode: 'reuse', projectId: String(flags.project) };
    return { mode: 'create_each_run' };
  }
  const value = String(raw);
  if (
    value === 'worktree' ||
    value === 'new-project' ||
    value === 'create-each-run' ||

View on GitHub (pinned to 5be4028344)

Solutions

  1. Use a 24h HH:MM value in the time slots, e.g. `--schedule weekly:mon:14:30`.
  2. Recount the colons: weekly is kind:DAY:HH:MM[:TZ] — make sure HH and MM are the 3rd and 4th segments.
  3. Drop AM/PM suffixes and any seconds component.

Example fix

// before
--schedule weekly:mon:2:30pm
// after
--schedule weekly:mon:14:30
Defensive patterns

Strategy: validation

Validate before calling

// For weekly: parts = kind:DAY:HH:MM[:TZ]; validate HH:MM = parts[2]:parts[3].
function weeklyTimeIsValid(raw: string): boolean {
  const parts = raw.split(':');
  if (parts.length < 4) return false;
  const time = `${parts[2].padStart(2,'0')}:${parts[3].padStart(2,'0')}`;
  return /^[0-2]\d:[0-5]\d$/.test(time);
}

Try / catch

try {
  parseScheduleFlag(raw);
} catch (err) {
  if (err instanceof Error && /weekly time must be HH:MM/.test(err.message)) {
    // fix the time slots (3rd and 4th colon segments)
  }
  throw err;
}

Prevention

When it happens

Trigger: Running `--schedule weekly:mon:25:30` (hour >23 shape), `--schedule weekly:mon:09:60` (minute >59), `--schedule weekly:mon:09:abc`, or `--schedule weekly:1:2:30pm`.

Common situations: Reusing a 12-hour time with AM/PM, misaligning the colon segments so the time lands in the wrong slots, or using `24:00` for midnight.

Related errors


AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12). Data as JSON: /api/errors/64476e5ca2e213a0. Report an issue: GitHub.