mirror of
https://github.com/saltbo/agent-kanban.git
synced 2026-09-19 09:01:47 +08:00
a2fa54a729
Replace the v1 Agent/Machine runtime and CLI architecture with the v2 Resource Server, AMA-backed projections, task lifecycle, session observation, BDD specifications, and a single-package layered codebase. BREAKING CHANGE: remove the v1 CLI, internal Agent/Machine runtime entities, workspace layout, and legacy runtime coordination APIs.
15 lines
570 B
TypeScript
15 lines
570 B
TypeScript
// Strict ISO 8601 datetime with required timezone (Z or ±HH:mm)
|
|
const ISO_8601_RE = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/;
|
|
|
|
/**
|
|
* Parse a strict ISO 8601 datetime string and return UTC ISO string.
|
|
* Requires full datetime with timezone. Rejects date-only, ambiguous, or non-standard formats.
|
|
* Returns null if invalid.
|
|
*/
|
|
export function parseScheduledAt(value: string): string | null {
|
|
if (!ISO_8601_RE.test(value)) return null;
|
|
const d = new Date(value);
|
|
if (Number.isNaN(d.getTime())) return null;
|
|
return d.toISOString();
|
|
}
|