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

Source

node_modules/@sapphire/cron/dist/esm/index.d.mts:62

Properties

cron

cron: string

Source

node_modules/@sapphire/cron/dist/esm/index.d.mts:52


days

days: number[]

Source

node_modules/@sapphire/cron/dist/esm/index.d.mts:56


dows

dows: number[]

Source

node_modules/@sapphire/cron/dist/esm/index.d.mts:58


hours

hours: number[]

Source

node_modules/@sapphire/cron/dist/esm/index.d.mts:55


minutes

minutes: number[]

Source

node_modules/@sapphire/cron/dist/esm/index.d.mts:54


months

months: number[]

Source

node_modules/@sapphire/cron/dist/esm/index.d.mts:57


normalized

normalized: string

Source

node_modules/@sapphire/cron/dist/esm/index.d.mts:53


normalize

private static normalize: any

Normalize the pattern

Param

The pattern to normalize

Source

node_modules/@sapphire/cron/dist/esm/index.d.mts:73


parsePart

private static parsePart: any

Parse the current part

Param

The part of the pattern to parse

Param

The id that identifies the current part

Source

node_modules/@sapphire/cron/dist/esm/index.d.mts:84


parseString

private static parseString: any

Parse the pattern

Param

The pattern to parse

Source

node_modules/@sapphire/cron/dist/esm/index.d.mts:78

Methods

next()

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

Get the next date that matches with the current pattern

Parameters

ParameterTypeDescription
outset?DateThe Date instance to compare with
origin?booleanWhether this next call is origin

Returns

Date

Source

node_modules/@sapphire/cron/dist/esm/index.d.mts:68