import { normalizeOptionalString } from "../shared/string-coerce.js"; import { parseAbsoluteTimeMs } from "./parse.js"; import type { CronSchedule } from "./types.js";
// Check if timestamp is in the past (allow 1 minute grace period) if (diffMs < -ONE_MINUTE_MS) { const nowDate = new Date(nowMs).toISOString(); const atDate = new Date(atMs).toISOString(); const minutesAgo = Math.floor(-diffMs / ONE_MINUTE_MS); return {
ok: false,
message: `schedule.at is in the past: ${atDate} (${minutesAgo} minutes ago). Current time: ${nowDate}`,
};
}
// Check if timestamp is too far in the future if (diffMs > TEN_YEARS_MS) { const atDate = new Date(atMs).toISOString(); const yearsAhead = Math.floor(diffMs / (365.25 * 24 * 60 * 60 * 1000)); return {
ok: false,
message: `schedule.at is too far in the future: ${atDate} (${yearsAhead} years ahead). Maximum allowed: 10 years`,
};
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.