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

Sunday #171

Open pekeler opened 8 years ago

pekeler commented 8 years ago

Fixes #152 (Sundays in cron can be either 0 or 7, Later only understood 0). This is better than the previous two PRs because this one also support ranges with 7 such as 5-7.

This implementation changes the existing parser such that it keeps the day-of-week represented as 0..7 (SUN..SUN) during parsing. And then only at the very end, right before returning the final set of schedules, do we change it to 1..7 (SUN..SAT) using the new postProcessSchedule() function.

niftylettuce commented 4 years ago

Per my work with Bree, I have an updated fork of this package called @breejs/later. See https://github.com/breejs/later if you would like to file this PR there.