question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Finding occurrences of a recurring event that are after some date

See original GitHub issue

I am trying to understand the event API. iterator() gets a start date but then uses that event as the base date-time to generate recurring events and ignores the event’s original dtstart. I am interested of finding the occurrences that happen after today for example and the only solution I found is to make a loop until it reaches the date-time I am interested in and this is not a neat solution.

  var iter = event.iterator();
   var next = iter.next();

    for (; next; next = iter.next()) {
        var occurrence = event.getOccurrenceDetails(next);
            if (isOccurrenceNow(datetime, occurence)) {
                return occurrence;
        }
    }

Am I missing something? I think from API point of view, event.iterator(startDate) would be more meaningful if it would the occurrences of the event from this point forward.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
StefanBrandcommented, Aug 5, 2018

That said, I am working on a new parser that should have better performance and get you exactly what you need, the occurrences between two dates (or starting after a date, for that matter). It should be complete in a month or two, or at least be semi-usable.

@kewisch Was this ever pulled upstream?

3reactions
itungcommented, Sep 12, 2016

@kewisch I am wondering what is the api call to get all recurring occurrences between two dates. After looking at the api I can’t find the api call that you state is being added to address this need. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Finding occurrences of a recurring event that are after some date
I am trying to understand the event API. iterator() gets a start date but then uses that event as the base date-time to...
Read more >
How can I use the occurrences to calculate the end date of a ...
1 Answer 1 · Keep it simple. · Introduce your own types to represent exactly what you know about the event. · Make...
Read more >
How to Quickly Count the Occurrences of a Recurring Outlook ...
Count the Occurrences of a Recurring Appointment in a Specific Date Range · First off, select or open the source recurring appointment. ·...
Read more >
A function to calculate recurring dates - sqlsunday.com
@start: The start date of the recurrence pattern. @end: The end date of the recurrence pattern. @occurrences: The maximum number of occurrences.
Read more >
Again and Again! Managing Recurring Events In a Data Model
The Naive Way: Storing all possible recurring instances of an event as separate rows in a table. In this solution, we require only...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found