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.
It seems one can't use and() if every clause has a year(). The schedule can be created correctly (I see an array like [{M: [2], Y: [2017]}, {M: [4], Y: [2018]}] in the schedules field), but calling next() errors. So it appears the issue is in getting occurrences for composite schedules, not in the parser.
e.g. it errors on later.schedule(sched).next(2) when sched is
Note that the second one's first clause is .on(2).month(), WITHOUT .on(2017).year().
As another clue, re-ordering the clauses (for example having the clause without .year() be the third clause instead of first) changes the behavior, in that case causing it to error.
Been liking the package! But this does appear to be a bug.
It seems one can't use
and()
if every clause has ayear()
. The schedule can be created correctly (I see an array like[{M: [2], Y: [2017]}, {M: [4], Y: [2018]}]
in theschedules
field), but callingnext()
errors. So it appears the issue is in getting occurrences for composite schedules, not in the parser.e.g. it errors on
later.schedule(sched).next(2)
when sched isbut not when sched is
Note that the second one's first clause is
.on(2).month()
, WITHOUT.on(2017).year()
.As another clue, re-ordering the clauses (for example having the clause without
.year()
be the third clause instead of first) changes the behavior, in that case causing it to error.Been liking the package! But this does appear to be a bug.