Skip to content
Français

CronSchedule

import type { CronSchedule } from "@elie-laloum/outpost";
  • expressionRequired
    string
    Normalized expression, with a macro replaced by its five fields.
  • timeZoneRequired
    string
    Canonical IANA time zone used for evaluation.
  • nextRequired
    (after: Date) => Date
    Return the first slot strictly after the given instant. A time skipped by daylight saving does not occur; a repeated time occurs once, at its first instant.
  • previousRequired
    (at: Date) => Date
    Return the latest slot at or before the given instant, with the same daylight saving rules as next().
export interface CronSchedule {
  readonly expression: string;
  readonly timeZone: string;
  /** First occurrence strictly after `after`. */
  next(after: Date): Date;
  /** Latest occurrence at or before `at`. */
  previous(at: Date): Date;
}