bunkat / later

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.
http://bunkat.github.io/later/
MIT License
2.42k stars 245 forks source link

After some events, getting the same date over and over #212

Open YHorsky opened 7 years ago

YHorsky commented 7 years ago

later.parse.recur().on(1).dayOfWeek().on(1).hour()

returns :

6/25/2017 1:00:00 AM 7/2/2017 1:00:00 AM 7/9/2017 1:00:00 AM 7/16/2017 1:00:00 AM 7/23/2017 1:00:00 AM 7/30/2017 1:00:00 AM 8/6/2017 1:00:00 AM 8/13/2017 1:00:00 AM 8/20/2017 1:00:00 AM 8/27/2017 1:00:00 AM 9/3/2017 1:00:00 AM 9/10/2017 1:00:00 AM 9/17/2017 1:00:00 AM 9/24/2017 1:00:00 AM 10/1/2017 1:00:00 AM 10/8/2017 1:00:00 AM 10/15/2017 1:00:00 AM 10/22/2017 1:00:00 AM 10/29/2017 1:00:00 AM 10/29/2017 1:00:00 AM 10/29/2017 1:00:00 AM 10/29/2017 1:00:00 AM 10/29/2017 1:00:00 AM 10/29/2017 1:00:00 AM 10/29/2017 1:00:00 AM 10/29/2017 1:00:00 AM 10/29/2017 1:00:00 AM 10/29/2017 1:00:00 AM 10/29/2017 1:00:00 AM Forever...

This does not happen if I change either 1's to another number.

YHorsky commented 7 years ago

Of course this also happens when using first(), for it is the same as on(1)