later
later copied to clipboard
Months can have 6 weeks, not 5
July 2016 has 6 weeks. The function weekofMonth makes the assumption that a month can only have 5 weeks. This results in some days getting skipped when using the following schedule:
var sched = later.parse.recur().every(1).weekOfMonth().on([1]).dayOfWeek();
var dates = later.schedule(sched).next(5, "2016-07-01T08:00:00.000Z");
In particular, July 31st is skipped despite being a Sunday in July. In its place, we get August 7th.