-
Notifications
You must be signed in to change notification settings - Fork 360
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
Add last_occurrence #117
Comments
The internal code iterates through all occurrence until it hits the end point. As a result, a method could be added which performs your approach, but there is no way to just arrive at the last date. Seeing as all calculations are performed in memory, what kind of delays are you seeing from the execution of |
|
I'm pretty sure. Because there are so many possible rules, and the ability to have multiple rule on a single schedule, it can become extremely complicated. DST, variable month lengths, leap years, etc make it additionally complex. Often, you must know when the previous item is to calculate the next occurrence. I'm not the library maintainer/author however, so @seejohnrun can give you a better answer. |
As a workaround, you could add a column in the database for the |
Yup, that's what I'm already doing. I just wanted to make the initial calculation fast as well. On Nov 19, 2012, at 9:44 AM, Eric Carty-Fickes [email protected] wrote:
|
Keep in mind that a rule must be It should work if we make it possible to jump backwards from a rule's For rules limited by |
|
We want to store schedules in the database, and require a way to quickly query whether a schedule (and all its occurrences) overlaps a certain time span. In order to do this, we want to store the beginning/end boundaries of the schedule.
Getting the beginning boundary is easy, since it's just the
schedule.start_time
, but there is no way to get the last occurrence (our non-performant workaround is to doschedule.all_occurrences.last
). It would be great to have aschedule.last_occurrence
.The text was updated successfully, but these errors were encountered: