Skip to content

[discussion] How to get all occurrences between start and end date? #29

Open
@syedkhairi

Description

@syedkhairi

What would you like to discuss?

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.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions