How to use cron

Comprehensive cron code examples:

How to use cron.CronTime:

186
187
188
189
190
191
192
193
194
195
}
if (endDate < startDate) {
  throw new Error('Invalid dates')
}

const cronTime = new CronTime(pattern, timezone)

let continueLoop = true
const dates = []
let cronISODate = new Date(new Date(startDate).getTime() - 1) // start from `startDate` minus 1 millisecond

How to use cron.CronJob:

202
203
204
205
206
207
208
209
210
211
    super.registerEntity(false);
}

createCronjob(crontab) {
    const node = this.node;
    this.cronjob = new CronJob({
        cronTime: crontab,
        onTick: () => {
            node.emit('input', {});
        },