*Maintained fork of 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.
How to get all the dates of occurrences between a defined start and end date?
Checklist
[ y] I have read the documentation.
The documentation shows:
later.schedule(schedule).next(count, start, end)
What if I want to find out all possible occurrences between two dates for example:
let sched = later.schedule(later.parse.text("every 2 days on Monday"));
let start = new Date('November 9, 2022 03:24:00');
let end = new Date('December 17, 2022 03:24:00');
let occurrences = sched.next(5, start, end);
console.log(occurrences);
So instead of;
let occurrences = sched.next(5, start, end);
is there a way to get all the occurrences between the two dates without limiting them to 5 dates.
I can do a workaround of a loop to check with end date, but I thought there might be a way already.
What would you like to discuss?
How to get all the dates of occurrences between a defined start and end date?
Checklist
The documentation shows:
later.schedule(schedule).next(count, start, end)
What if I want to find out all possible occurrences between two dates for example:
So instead of;
let occurrences = sched.next(5, start, end);
is there a way to get all the occurrences between the two dates without limiting them to5
dates.I can do a workaround of a loop to check with end date, but I thought there might be a way already.
Thanks