Class: Cron
Defined in: Cron.ts:8
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
Defined in: Cron.ts:20
Parameters
Parameter | Type | Description |
---|---|---|
cron | string | The cron pattern to use |
Returns
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()
Defined in: Cron.ts:31
Get the next date that matches with the current pattern
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
outset | Date | ... | The Date instance to compare with |
origin | boolean | true | Whether this next call is origin |
Returns
toString()
toString():
string
Defined in: Cron.ts:55
Returns the string that represents this cron pattern
Returns
string
The string that represents this cron pattern
normalize()
private
static
normalize(cron
:string
):string
Defined in: Cron.ts:63
Normalize the pattern
Parameters
Parameter | Type | Description |
---|---|---|
cron | string | The pattern to normalize |
Returns
string
parsePart()
private
static
parsePart(cronPart
:string
,id
:number
):number
[]
Defined in: Cron.ts:109
Parse the current part
Parameters
Parameter | Type | Description |
---|---|---|
cronPart | string | The part of the pattern to parse |
id | number | The id that identifies the current part |
Returns
number
[]
parseString()
private
static
parseString(cron
:string
):number
[][]
Defined in: Cron.ts:98
Parse the pattern
Parameters
Parameter | Type | Description |
---|---|---|
cron | string | The pattern to parse |
Returns
number
[][]