Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug getting next() occurrences with composite schedule where each clause has a year #216

Open
tscizzle opened this issue Nov 1, 2017 · 0 comments

Comments

@tscizzle
Copy link

tscizzle commented Nov 1, 2017

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

.on(2).month().on(2017).year()
.and()
.on(3).month().on(2018).year()
.and()
.on(4).month().on(2019).year()

but not when sched is

.on(2).month()
.and()
.on(3).month().on(2018).year()
.and()
.on(4).month().on(2019).year()

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant