Closed rajpa closed 7 years ago
Yeah, in general Later assumes that all of the constraints are pre-sorted. If you do a console.log on the schedule that is created you will see it is just a buch of key value pairs where the values are arrays. Make sure each of the arrays are sorted before you calculate occurrences and you should be all set.
thanks @bunkat. the problem arises if I do schedule.next(100, start, end) in which case, the "sun" occurences just vanish completely, having come last... hope that clarifies..
cheers/rajpa
Sun needs to come first since it's the lowest day value in Later. If you sort the constraints after creating the schedule it will work as expected.
hi @bunkat
firstly, thanks for a great package! absolutely love it!!
onto the bug..
if the schedule is specified as "at 8:00 pm on sun, mon, tue, wed, sat" it works.
if the schedule is specified as "at 8:00 pm on mon, tue, wed, sat, sun" it breaks!! by which i mean it skips the first few occurrences completely.
Cheers rajpa