|
@@ -38,7 +38,11 @@ const LOCAL_TIME = /^(?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2})(?:\.(?<fra
|
|
|
const IANA_ZONE = /^[A-Za-z][A-Za-z0-9_+.-]*(?:\/[A-Za-z0-9_+.-]+)+$/
|
|
const IANA_ZONE = /^[A-Za-z][A-Za-z0-9_+.-]*(?:\/[A-Za-z0-9_+.-]+)+$/
|
|
|
const OFFSET_NAME = /^GMT(?:(?<sign>[+-])(?<hour>\d{2}):(?<minute>\d{2})(?::(?<second>\d{2}))?)?$/
|
|
const OFFSET_NAME = /^GMT(?:(?<sign>[+-])(?<hour>\d{2}):(?<minute>\d{2})(?::(?<second>\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 {
|
|
export function isRecurringGateExhausted(lastAcceptedAt: string | undefined): boolean {
|
|
|
return lastAcceptedAt !== undefined
|
|
return lastAcceptedAt !== undefined
|
|
|
&& Date.parse(lastAcceptedAt) + MIN_RECURRING_INTERVAL_SECONDS * 1_000 > MAX_FOUR_DIGIT_YEAR_MS
|
|
&& Date.parse(lastAcceptedAt) + MIN_RECURRING_INTERVAL_SECONDS * 1_000 > MAX_FOUR_DIGIT_YEAR_MS
|