diff --git a/packages/schedule/tool-schedule/src/domain.ts b/packages/schedule/tool-schedule/src/domain.ts index a36dd6a220..31b2f6372e 100644 --- a/packages/schedule/tool-schedule/src/domain.ts +++ b/packages/schedule/tool-schedule/src/domain.ts @@ -38,7 +38,11 @@ const LOCAL_TIME = /^(?\d{2}):(?\d{2}):(?\d{2})(?:\.(?[+-])(?\d{2}):(?\d{2})(?::(?\d{2}))?)?$/ -/** Whether the durable recurring gate has no four-digit-year admission left. */ +/** + * Whether the durable recurring gate has no four-digit-year admission left. + * @param lastAcceptedAt - Latest accepted recurring batch, when any. + * @returns `true` only when another compliant batch time is unrepresentable. + */ export function isRecurringGateExhausted(lastAcceptedAt: string | undefined): boolean { return lastAcceptedAt !== undefined && Date.parse(lastAcceptedAt) + MIN_RECURRING_INTERVAL_SECONDS * 1_000 > MAX_FOUR_DIGIT_YEAR_MS