-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get currently running events #9
Comments
Shouldn't be too hard to implement! PR welcome :) |
Wouldn't this be solved by passing the same date for start/end times? Example: const events = icalExpander.between(
new Date(),
new Date()
); Existing code seems to cover the use-case (as also depicted in the diagram in the README) // After and before are just the params passed in to between(before, after)
function isEventWithinRange(startTime, endTime) {
return (!after || endTime >= after.getTime()) &&
(!before || startTime <= before.getTime());
} |
Could be! Someone 🙈 just needs to write some tests to verify all scenarios (time after, time before, time within event, full day) |
Here is an another idea, that would also cover my use-case of finding the events at the specific date and time: at(date) {
return this.between(date, date);
}
now() {
return this.at(new Date());
} |
Sure. PR welcome! |
Is there an ability to get currently running events, perhaps with
IcalExpander.now()
?things
now()
would catch for all events (including recurring):The text was updated successfully, but these errors were encountered: