JonasWanke / rrule

🔁 Recurrence rule parsing & calculation as defined in the iCalendar RFC
https://pub.dev/packages/rrule
Apache License 2.0
52 stars 22 forks source link

Adding the dtstart property in the RRULE #65

Open ericyunwen opened 10 months ago

ericyunwen commented 10 months ago

If you look at a more elaborated approach here http://jkbrzt.github.io/rrule/,

You will notice the property dtstart which is the start date of the rule. It should work similarly but opposite to the until property.

It will be great to have this included as a property. I also will like to work on this if no one is available to contribute

jonasbadstuebner commented 9 months ago

DTSTART is not part of the RRULE, it's a seperate property of an iCalendar object. So I am not sure, if this would be the best way to handle the property, if there is start as parameter...IMO this is not needed. Do you have a specific use case?

In the end @JonasWanke has to decide if this should be implemented as rrule.js does it. This package is based on rrule.js already.

JonasWanke commented 9 months ago

I lean towards not including it inside the RecurrenceRule for the reason mentioned by DrBu7cher above. We could maybe add a wrapper class that can store start and the recurrence rule (possibly being generic so it also supports RecurrenceSets (#1) in the future), but I don't really think this class would be worth it.

hamishjohnson commented 9 months ago

I also would like this, I mistakenly thought dtstart was part of rrule's in general and introduced a bug because of that, as I was doing everything server side before, and old rrules which had dtstart don't parse. I do think it's a useful feature to have as it does have revelance to how rrules should schedule items.