UNPKG

@lou.codes/cron

Version:

⏲️ Cron Quartz and Cron UNIX expression parser

20 lines (19 loc) 635 B
import type { CronObject } from "./CronObject.js"; import type { CronString } from "./CronString.js"; /** * Get next ISO date iterator for the given date and the given cron expression. * * @category Util * @example * ```typescript * take(2)(nextDates(new Date("1989-10-13T10:15:00.000Z"))("* * * * *")); * // [Date("1989-10-13T10:16:00.000"), Date("1989-10-13T10:17:00.000Z")] * ``` * @param date Base date to get the next date from. * @returns Curried function with date set. */ export declare const nextDates: ( date: Readonly<Date>, ) => ( cron: CronString | Partial<CronObject>, ) => Readonly<IterableIterator<Date>>;