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 246 forks source link

OnValid function throwing a.getTime is not a function error when working with a composite schedule #169

Open Ankurrana opened 8 years ago

Ankurrana commented 8 years ago

Code Snippet :

var schedule = 

later.parse.recur()
.on(25).dayOfMonth().on(5).month().on(2016).year()
.and()
.on(26).dayOfMonth().on(5).month().on(2016).year()
.and()
.on(27).dayOfMonth().on(5).month().on(2016).year()

var sched = later.schedule(schedule);
var ans = sched.isValid(new Date('2016-05-27'));
console.log(ans);

Error Message:

TypeError: a.getTime is not a function
at f:\Projects\DragonFly\node_modules\later\later.js:777:24
at findNext (f:\Projects\DragonFly\node_modules\later\later.js:785:23)
at getInstances (f:\Projects\DragonFly\node_modules\later\later.js:637:52)