Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Cron

Instance of a cron schedule - avoids re-parsing the string for each time you want to execute the schedule.

param

Cron schedule string e.g. 0,30 9-17 * * MON-FRI

throws

If the schedule string is not valid cron syntax.

Hierarchy

  • Cron

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Cron(schedule: string): Cron

Properties

Private Readonly schedule

schedule: Schedule

Methods

next

  • next(from?: Date): undefined | Date
  • Fetch the next time in the cron schedule

    Parameters

    • Optional from: Date

      Option start point after which to find the next matching date.

    Returns undefined | Date

    The next date in the sequence or undefined if there are no more dates in the sequence.

Generated using TypeDoc