kewisch / kewisch/ical.js

Add a "between" iterator on RecurExpansion

Open
#148 15 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
1.2k
Forks
156
Avg merge
4d 43m
Merged PRs (30d)
3

Description

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.

Contributor guide

Open the contributing guide

Research direction

Start by reading RecurExpansion and the event iterator() path to understand how the start date and original dtstart are currently used. Review the issue discussion for the intended between-iteration semantics, then define and test behavior for occurrences after a supplied date without requiring callers to loop from the beginning.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.