Private
#datePrivate
#dstPrivate
#dstReturns daylight savings end time.
+Sets daylight savings end time.
+Returns daylight savings start time.
+Sets daylight savings start time.
+Private
#getUTCAdds a unit of time to the current CronDate.
+Primarily for internal use.
+The operation to perform.
+The unit of time to use.
+Optional
hoursLength: numberThe length of the hours. Required when unit is not month or day.
+Handles a math operation.
+{'add' | 'subtract'}
+{'year' | 'month' | 'day' | 'hour' | 'minute' | 'second'}
+Subtracts a unit of time from the current CronDate.
+Generated using TypeDoc
Represents the "day of the month" field within a cron expression.
+CronDayOfMonth constructor. Initializes the "day of the month" field with the provided values.
+ +if validation fails
+Values for the "day of the month" field
+Optional
wildcard: boolean = falseWhether this field is a wildcard
+Private
Readonly
#valuesPrivate
Readonly
#wildcardReturns an array of allowed special characters for this field.
+Indicates whether this field is a wildcard.
+Returns the maximum value allowed for this field.
+Returns the minimum value allowed for this field.
+Returns an array of allowed values for the "day of the month" field.
+Static
charsStatic
constraintsReturns the constraints for this field.
+Static
maxStatic
minStatic
validReturns the regular expression used to validate this field.
+Serializes the field to an object.
+ +This is really only for debugging, should it be removed?
+Static
sorterGenerated using TypeDoc
Represents the "day of the week" field within a cron expression.
+CronDayOfTheWeek constructor. Initializes the "day of the week" field with the provided values.
+Values for the "day of the week" field
+Optional
wildcard: boolean = falseWhether this field is a wildcard
+Private
Readonly
#valuesPrivate
Readonly
#wildcardReturns an array of allowed special characters for this field.
+Indicates whether this field is a wildcard.
+Returns the maximum value allowed for this field.
+Returns the minimum value allowed for this field.
+Returns an array of allowed values for the "day of the week" field.
+Static
charsStatic
constraintsReturns the constraints for this field.
+Static
maxStatic
minStatic
validReturns the regular expression used to validate this field.
+Serializes the field to an object.
+ +This is really only for debugging, should it be removed?
+Static
sorterGenerated using TypeDoc
Class representing a Cron expression.
+Creates a new CronExpression instance.
+Cron fields.
+Parser options.
+Private
#currentPrivate
Readonly
#endPrivate
Readonly
#fieldsPrivate
#hasPrivate
Readonly
#isPrivate
Readonly
#nthPrivate
#optionsPrivate
Readonly
#startPrivate
Optional
Readonly
#tzGetter for the cron fields.
+Cron fields.
+Private
#findPrivate
+Finds the next or previous schedule based on the cron expression.
+Optional
reverse: boolean = falseIf true, finds the previous schedule; otherwise, finds the next schedule.
+Private
#matchPrivate
+Determines if the given date matches the cron expression's day of month and day of week fields.
+The function checks the following rules: +Rule 1: If both "day of month" and "day of week" are restricted (not wildcard), then one or both must match the current day. +Rule 2: If "day of month" is restricted and "day of week" is not restricted, then "day of month" must match the current day. +Rule 3: If "day of month" is a wildcard, "day of week" is not a wildcard, and "day of week" matches the current day, then the match is accepted. +If none of the rules match, the match is rejected.
+ +CronExpression
+The current date to be evaluated against the cron expression.
+Returns true if the current date matches the cron expression's day of month and day of week fields, otherwise false.
+Private
#matchDetermines if the current hour matches the cron expression.
+The current date object.
+The date math operation enumeration value.
+A flag indicating whether the matching should be done in reverse order.
+Check if the cron expression includes the given date
+Iterate over a specified number of steps and optionally execute a callback function for each step.
+ +CronExpression
+The number of steps to iterate. Positive value iterates forward, negative value iterates backward.
+Optional
callback: CronExpressionIteratorCallbackOptional callback function to be executed for each step.
+Find the next scheduled date based on the cron expression.
+ +CronExpression
+Find the previous scheduled date based on the cron expression.
+ +CronExpression
+Reset the iterators current date to a new date or the initial date.
+ +CronExpression
+Optional
newDate: Date | CronDateOptional new date to reset to. If not provided, it will reset to the initial date.
+Generate a string representation of the cron expression.
+ +CronExpression
+Optional
includeSeconds: boolean = falseWhether to include the seconds field in the string representation.
+Static
Private
#isLInPrivate
+Checks if the 'L' character is present in any of the given expressions.
+ +CronExpression
+An array of expressions to be checked.
+Static
Private
#isPrivate
+Determines if the current date matches the last specified weekday of the month.
+ +CronExpression
+An array of expressions containing weekdays and "L" for the last weekday.
+The current date object.
+Static
Private
#matchPrivate
+Checks if the given value matches any element in the sequence.
+ +CronExpression
+The value to be matched.
+The sequence to be checked against.
+Static
fieldsConverts cron fields back to a CronExpression instance.
+The input cron fields object.
+Optional
options: CronExpressionOptionsOptional parsing options.
+Static
parseAsynchronously parses the input cron expression string.
+The input cron expression string.
+Optional
options: CronParseOptions = {}Optional parsing options.
+Generated using TypeDoc
Abstract
Represents a field within a cron expression. +This is a base class and should not be instantiated directly.
+Protected
constructorCronField constructor. Initializes the field with the provided values.
+ +if the constructor is called directly
+ +if validation fails
+Values for this field
+Optional
wildcard: boolean = falseWhether this field is a wildcard
+Private
Readonly
#valuesPrivate
Readonly
#wildcardReturns an array of allowed special characters for this field.
+Indicates whether this field is a wildcard.
+Returns the maximum value allowed for this field.
+Returns the minimum value allowed for this field.
+Returns an array of allowed values for this field.
+Static
charsStatic
constraintsReturns the constraints for this field.
+Static
maxStatic
minStatic
validReturns the regular expression used to validate this field.
+Serializes the field to an object.
+ +This is really only for debugging, should it be removed?
+Static
sorterGenerated using TypeDoc
Represents a complete set of cron fields.
+CronFieldCollection constructor. Initializes the cron fields with the provided values.
+ +if validation fails
+ +const cronFields = new CronFieldCollection({
second: new CronSecond([0]),
minute: new CronMinute([0, 30]),
hour: new CronHour([9]),
dayOfMonth: new CronDayOfMonth([15]),
month: new CronMonth([1]),
dayOfWeek: new CronDayOfTheWeek([1, 2, 3, 4, 5]),
})
console.log(cronFields.second.values); // [0]
console.log(cronFields.minute.values); // [0, 30]
console.log(cronFields.hour.values); // [9]
console.log(cronFields.dayOfMonth.values); // [15]
console.log(cronFields.month.values); // [1]
console.log(cronFields.dayOfWeek.values); // [1, 2, 3, 4, 5]
+
+The cron fields values
+Private
Readonly
#dayPrivate
Readonly
#dayPrivate
Readonly
#hourPrivate
Readonly
#minutePrivate
Readonly
#monthPrivate
Readonly
#secondReturns the day of the month field.
+Returns the day of the week field.
+Returns the minute field.
+Returns the second field.
+Returns a serialized representation of the cron fields values.
+An object containing the cron field values
+Returns a string representation of the cron fields.
+ +The cron field to stringify
+Static
Private
#handlePrivate
+Handles a single range.
+The month range.
+The day of the month range.
+The day of the month range.
+Static
Private
#handlePrivate
+Handles multiple ranges.
+{start: number, end: number, step: number, count: number} The range to handle.
+The maximum value for the field.
+The stringified range.
+Static
Private
#handlePrivate
+Handles a single range.
+{start: number, end: number, step: number, count: number} The range to handle.
+The minimum value for the field.
+The maximum value for the field.
+The stringified range or null if it cannot be stringified.
+Static
compactReturns a string representation of the cron fields.
+ +The cron fields values
+Generated using TypeDoc
Represents the "hour" field within a cron expression.
+CronHour constructor. Initializes the "hour" field with the provided values.
+Values for the "hour" field
+Optional
wildcard: boolean = falseWhether this field is a wildcard
+Private
Readonly
#valuesPrivate
Readonly
#wildcardReturns an array of allowed special characters for this field.
+Indicates whether this field is a wildcard.
+Returns the maximum value allowed for this field.
+Returns the minimum value allowed for this field.
+Returns an array of allowed values for the "hour" field.
+Static
charsStatic
constraintsReturns the constraints for this field.
+Static
maxStatic
minStatic
validReturns the regular expression used to validate this field.
+Serializes the field to an object.
+ +This is really only for debugging, should it be removed?
+Static
sorterGenerated using TypeDoc
Represents the "second" field within a cron expression.
+CronSecond constructor. Initializes the "second" field with the provided values.
+Values for the "second" field
+Optional
wildcard: boolean = falseWhether this field is a wildcard
+Private
Readonly
#valuesPrivate
Readonly
#wildcardReturns an array of allowed special characters for this field.
+Indicates whether this field is a wildcard.
+Returns the maximum value allowed for this field.
+Returns the minimum value allowed for this field.
+Returns an array of allowed values for the "second" field.
+Static
charsStatic
constraintsReturns the constraints for this field.
+Static
maxStatic
minStatic
validReturns the regular expression used to validate this field.
+Serializes the field to an object.
+ +This is really only for debugging, should it be removed?
+Static
sorterGenerated using TypeDoc
Represents the "day of the month" field within a cron expression.
+CronDayOfMonth constructor. Initializes the "day of the month" field with the provided values.
+Values for the "day of the month" field
+Optional
wildcard: boolean = falseWhether this field is a wildcard
+Private
Readonly
#valuesPrivate
Readonly
#wildcardReturns an array of allowed special characters for this field.
+Indicates whether this field is a wildcard.
+Returns the maximum value allowed for this field.
+Returns the minimum value allowed for this field.
+Returns an array of allowed values for the "day of the month" field.
+Static
charsStatic
constraintsReturns the constraints for this field.
+Static
daysStatic
maxStatic
minStatic
validReturns the regular expression used to validate this field.
+Serializes the field to an object.
+ +This is really only for debugging, should it be removed?
+Static
sorterGenerated using TypeDoc
Static
Private
#parsePrivate
+Parse crontab entry
+Crontab file entry/line
+Static
fieldsWrapper for CronExpression.fieldsToExpression method
+Input fields
+Optional
options: objectParsing options
+Static
parseWrapper for CronExpression.parse method
+Input expression
+Optional
options: objectParsing options
+Static
parseParse crontab file
+Path to file
+Optional
data: ParseStringResponseStatic
parseParse content string
+Crontab content
+Generated using TypeDoc
Represents the "second" field within a cron expression.
+CronSecond constructor. Initializes the "second" field with the provided values.
+Values for the "second" field
+Optional
wildcard: boolean = falseWhether this field is a wildcard
+Private
Readonly
#valuesPrivate
Readonly
#wildcardReturns an array of allowed special characters for this field.
+Indicates whether this field is a wildcard.
+Returns the maximum value allowed for this field.
+Returns the minimum value allowed for this field.
+Returns an array of allowed values for the "second" field.
+Static
charsStatic
constraintsReturns the constraints for this field.
+Static
maxStatic
minStatic
validReturns the regular expression used to validate this field.
+Serializes the field to an object.
+ +This is really only for debugging, should it be removed?
+Static
sorterGenerated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Optional
currentOptional
endOptional
expressionOptional
iteratorOptional
nthOptional
startOptional
tzOptional
utcGenerated using TypeDoc
Generated using TypeDoc
Optional
currentOptional
endOptional
expressionOptional
iteratorOptional
nthOptional
startOptional
strictOptional
tzGenerated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
CronDate class that wraps the Luxon DateTime object to provide +a consistent API for working with dates and times in the context of cron.
+