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
Source
Properties
cron
cron:
string
Source
days
days:
number[]
Source
dows
dows:
number[]
Source
hours
hours:
number[]
Source
minutes
minutes:
number[]
Source
months
months:
number[]
Source
normalized
normalized:
string
Source
Methods
next()
Get the next date that matches with the current pattern
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
outset | Date | undefined | The Date instance to compare with |
origin | boolean | true | Whether this next call is origin |
Returns
Source
normalize()
privatestaticnormalize(cron:string):string
Normalize the pattern
Parameters
| Parameter | Type | Description |
|---|---|---|
cron | string | The pattern to normalize |
Returns
string
Source
parsePart()
privatestaticparsePart(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[]
Source
parseString()
privatestaticparseString(cron:string):number[][]
Parse the pattern
Parameters
| Parameter | Type | Description |
|---|---|---|
cron | string | The pattern to parse |
Returns
number[][]