Skip to content
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 repeating events? #21

Open
c0dezli opened this issue May 6, 2017 · 3 comments
Open

Add repeating events? #21

c0dezli opened this issue May 6, 2017 · 3 comments

Comments

@c0dezli
Copy link

c0dezli commented May 6, 2017

Is it possible to add repeating events like "Homework due Tuesday 12:00pm every week until May 7"?

@neilgupta
Copy link
Owner

This is a great idea, but implementing repeating events would require a big refactor and not something I have planned for now.

Implementing repeating events can be tricky without knowing how it's going to be used. Does the user need an array of every date the event will repeat on, or just another key in the Sherlock object like repeat: "weekly", end_repeat: "5/7/2017"? There are also lot of edge cases to repeating events, like how does "Exam on Jan 30, repeat every month" behave in February?

@jayenne
Copy link

jayenne commented Jun 7, 2017

It may work well if you returned the extracted operator 9first/last/next/previous/every/alternate/everyother/everysecond/everythird/everyfourth.../) and the date range array
For edge cases you could allow for the provision of a callback function on the date range array*.
*If the operator creates a repeat that has no end date then return the operator and the next occurrence only.
It would be down to the individual developer to then handle the data accordingly (use, store or refactor)

if I was handling a "repeat every other Thursday" without an end date, as a developer I'd know how long I needed to "trust" that data for before needing to re calculate it. I'd store that data in a way that mean's I will probably just need it for the session tbh.

@iconicschema
Copy link

You could map this to the iCal rrule format

This project has an input interpreter
https://jakubroztocil.github.io/rrule/

Here is the json iCal rfc
https://tools.ietf.org/html/rfc7265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants