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.
I noticed that when you call .next(1) on a schedule, it returns only a single Date object, but when you call it with a value greater than one, it returns an Array. This forces me to make odd exceptions in my code. Is there a configuration or extension point where I can tell next() to always return an Array?
I'd like to add to this: If there are no subsequent occurrences, .next() returns a number (0). So we have to check for up to three conditions: a number, a Date, and an array of Date.
I noticed that when you call
.next(1)
on a schedule, it returns only a singleDate
object, but when you call it with a value greater than one, it returns an Array. This forces me to make odd exceptions in my code. Is there a configuration or extension point where I can tellnext()
to always return an Array?