Class CronExpression

Class representing a Cron expression.

Constructors

Accessors

Methods

  • Returns an iterator for iterating through future CronDate instances

    Returns Iterator<CronDate>

    An iterator object for CronExpression that returns CronDate values.

    Symbol.iterator

    CronExpression

  • Check if there is a next scheduled date based on the current date and cron expression.

    Returns boolean

    • Returns true if there is a next scheduled date, false otherwise.

    CronExpression

  • Check if there is a previous scheduled date based on the current date and cron expression.

    Returns boolean

    • Returns true if there is a previous scheduled date, false otherwise.

    CronExpression

  • Find the next scheduled date based on the cron expression.

    Returns CronDate

    • The next scheduled date or an ES6 compatible iterator object.

    CronExpression

  • Find the previous scheduled date based on the cron expression.

    Returns CronDate

    • The previous scheduled date or an ES6 compatible iterator object.

    CronExpression

  • Reset the iterators current date to a new date or the initial date.

    Parameters

    • OptionalnewDate: CronDate | Date

      Optional new date to reset to. If not provided, it will reset to the initial date.

    Returns void

    CronExpression

  • Generate a string representation of the cron expression.

    Parameters

    • OptionalincludeSeconds: boolean = false

      Whether to include the seconds field in the string representation.

    Returns string

    • The string representation of the cron expression.

    CronExpression

  • Iterate over a specified number of steps and optionally execute a callback function for each step.

    Parameters

    • limit: number

    Returns CronDate[]

    • An array of iterator fields or CronDate objects.

    CronExpression

  • Returns the string representation of the cron expression.

    Returns string

    • The next schedule date.