-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Calculating Occurrences #5
Comments
Hey JH I'm very open to PRs, thanks for the help. DateTime support would be fantastic. As for the other features, they sound like good additions. It'd be nice to have an issue opened that detailed what sort of API you'd have for this feature before you implement it. :) Cheers, |
Calculating OccurrencesI've been doing some research into how other libraries such as ice_cube handle the production of occurrences. Based on my research I will present my opinions on what we should do to implement the occurrences correctly. IntervalsIn order to build occurrences, we need to build logic to understand the interval between each occurrence. This should be calculated in a certain order - from smallest differentiator (second) to largest (year). DURATION PropertyI believe we'll need to support the Duration property. This will allow us to establish for how long an occurence will last. This will be used when calculating the intervals. VTIMEZONE PropertyFrom the iCal spec on RRULE:
In order to ensure RRULEs are generated with the correct timezone, it's important we support Windows of interestWe should count forward from a certain point in time to the window of time that we're interested in, only recording the time periods which we've marked as interesting. It'd be cool to investigate further the viability of using Streams to build a module to handle this lazily. If |
Heya I'm having a little trouble understanding exactly what this feature is. Could you step back a little and explain occurrences and their usage? Currently it feels out of the scope of this (de)serialisation library to actually calculate them. |
@lpil you may be right that it's out of scope - I'll leave the final call on that to you.
If we agree that it is out of scope, I can always create an ICalendar.RRULE library which is designed to be compatible with this one. |
This seems like the kind of functionality that would be very handy to have outside of the context of ics files. Let's make it another project, and we can add it as a dep or plugin if desired. |
Just noting here that I found a lib that's made a start on calculating occurrences based on https://github.com/alaister/elixir_rrule/blob/master/lib/RRule.ex # after line 45 Reviewing for my short term needs now and seeing if there is anything worthy of rolling into our work. |
Here's another implementation I'm reviewing: https://github.com/fazibear/ex_ical/blob/master/lib/ex_ical/recurrence.ex |
I've finally extracted my work on this so that it can be public! Work-in-progress at https://github.com/walter/icalendar_event_occurrence |
Great! Should we link this from the README? |
It has a dependency on RRULE implementation being in place, so I think adding it to the README from within the feature/rrule branch PR makes sense. |
I have added |
Hi there,
I/we will be looking to port some ruby code which made use of the ice_cube gem in the near future. I thought before we begin working on PRs for this repo we'd check to see if you have any thoughts on the following bits of functionality we plan to implement in order to port over successfully:
Do you have any advice / tips / etc with regards to how this stuff gets implemented that will make sure we have a higher chance of getting merged? Any thoughts on how you'd implement these features?
Best
JH
The text was updated successfully, but these errors were encountered: