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
Parameter | Type | Description |
---|---|---|
cron | string | The cron pattern to use |
Returns
Defined in
Properties
cron
cron:
string
Defined in
days
days:
number
[]
Defined in
dows
dows:
number
[]
Defined in
hours
hours:
number
[]
Defined in
minutes
minutes:
number
[]
Defined in
months
months:
number
[]
Defined in
normalized
normalized:
string
Defined in
Methods
next()
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
Defined in
toString()
toString():
string
Returns the string that represents this cron pattern
Returns
string
The string that represents this cron pattern
Defined in
normalize()
private
static
normalize(cron
:string
):string
Normalize the pattern
Parameters
Parameter | Type | Description |
---|---|---|
cron | string | The pattern to normalize |
Returns
string
Defined in
parsePart()
private
static
parsePart(cronPart
:string
,id
:number
):number
[]
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
[]
Defined in
parseString()
private
static
parseString(cron
:string
):number
[][]
Parse the pattern
Parameters
Parameter | Type | Description |
---|---|---|
cron | string | The pattern to parse |
Returns
number
[][]