later icon indicating copy to clipboard operation
later copied to clipboard

Months can have 6 weeks, not 5

Open ascott18 opened this issue 9 years ago • 0 comments

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.

ascott18 avatar Mar 31 '16 18:03 ascott18