A javascript library for defining recurring schedules and calculating future (or past) occurrences for them. Includes support for using English phrases and Cron schedules. Works in Node and in the browser.
Below is some code I consider pretty simple and straightforward.
The output (below) is I would expect, except that it acts as though I'm wanting it to operate on UTC +0, meaning that it considers 8 to be 3am and 17 to be 12pm!
is there a way other than changing those number to adjust the time zone? I'd rather it take into account daylight savings, etc.
let later = require('later')
let schedule = later.parse.recur()
.every(1).hour().between(8, 17)
.on(30).minute()
.onWeekday()
let sched = later.schedule(schedule)
console.info(`${moment().format('YYYY-MM-DD hh:mm')} <-- now`)
sched.next(5, new Date()).forEach(s => {
console.info(moment(s).format('YYYY-MM-DD hh:mm'))
})
Below is some code I consider pretty simple and straightforward.
The output (below) is I would expect, except that it acts as though I'm wanting it to operate on UTC +0, meaning that it considers 8 to be 3am and 17 to be 12pm!
is there a way other than changing those number to adjust the time zone? I'd rather it take into account daylight savings, etc.