Skip to main content

Class: Cron

Handles Cron strings and generates dates based on the cron string provided.

See

https://en.wikipedia.org/wiki/Cron

Constructors

new Cron()

new Cron(cron: string): Cron

Parameters

ParameterTypeDescription
cronstringThe cron pattern to use

Returns

Cron

Defined in

Cron.ts:20

Properties

cron

cron: string

Defined in

Cron.ts:9


days

days: number[]

Defined in

Cron.ts:13


dows

dows: number[]

Defined in

Cron.ts:15


hours

hours: number[]

Defined in

Cron.ts:12


minutes

minutes: number[]

Defined in

Cron.ts:11


months

months: number[]

Defined in

Cron.ts:14


normalized

normalized: string

Defined in

Cron.ts:10

Methods

next()

next(outset: Date, origin: boolean): Date

Get the next date that matches with the current pattern

Parameters

ParameterTypeDefault valueDescription
outsetDate...The Date instance to compare with
originbooleantrueWhether this next call is origin

Returns

Date

Defined in

Cron.ts:31