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

later.parse.cron not working properly if cron expression include days like MON, WED and FRI #233

Open tak2ashokkumar opened 6 years ago

tak2ashokkumar commented 6 years ago

Cron Expression "0 0 3 ? " WED,FRI means "At 03:00 AM, only on Wednesday and Friday"

var cron_schedule = later.parse.cron(0 0 3 ? WED,FRI ); var first_schedule = later.schedule(cron_schedule).next();

here in this case first_schedule is not giving appropriate results...

In Same way if i do

var cron_schedule_with_text = later.parse.text(At 03:00 AM, only on Wednesday and Friday); var first_schedule_date = later.schedule(cron_schedule_with_text ).next();

Even in this case also first_schedule_date is not giving appropriate results...

But one more thing i observed here is Result of "first_schedule" and "first_schedule_date" has considerable difference.

Please check it ASAP.