Closed kelvinst closed 3 years ago
It does not respect RRULE RFC at all, as per documentation "It loosely follows iCal Recurrence rule specification RFC 2445.". I've put loosely there because I had no intention to make it strict RFC compliance, in fact in the project I needed it for I needed it to round up to the last day of the month in this specific case.
As for changing it, If I ever do that it would have to be some kind of option like mode: :strict
or something like that.
If you fancy doing it yourself, I'm happy to accept PR with condition that it can work both ways.
Alright, I do have the change in my fork already, I just need to add a flag for it. Not sure if I'm going to be able to do that soon though. Let's see 👍
As for changing it, If I ever do that it would have to be some kind of option like mode: :strict or something like that. If you fancy doing it yourself, I'm happy to accept PR with condition that it can work both ways.
@pbogut
So this option you mention, do you prefer RecurringEvents.unfold(~D[2020-10-31], %{freq: :monthly, mode: :strict})
or RecurringEvents.unfold(~D[2020-10-31], %{freq: :monthly}, mode: :strict)
?
PS.: the latter would make some functions conflict on the public API, probably possible to do not breaking compatibility of the main API, but will have to do some juggling with the functions params.
I would say former, and it looks like that's the way you did it in PR, so that's fine.
The RRULE
FREQ=MONTHLY;INTERVAL=1;DTSTART=20201031T000000
should actually skip november according to RRULE RFC:So basically, this test should pass: