volkanunsal / postgres-rrule

Recurring dates in Postgres.
MIT License
106 stars 26 forks source link

Infinite Events #14

Closed MrFastDie closed 3 years ago

MrFastDie commented 3 years ago

I come to the problem that when there is no COUNT or UNTIL definied in the RRULE the expected behavior should be that the event is repeated infinitly.

SELECT *
FROM occurrences(
        'RRULE:FREQ=WEEKLY;UNTIL=20250902T090000'::TEXT,
        '2020-04-19T17:50:00'::TIMESTAMP,
        tsrange(now()::timestamp, now()::timestamp + (interval '7d'))
    );

With this Query the Output is the expected Date (2021-05-02 17:50:00.000000) but when I remove the UNTIL statement from the RRULE I don't get any result

SELECT *
FROM occurrences(
        'RRULE:FREQ=WEEKLY'::TEXT,
        '2020-04-19T17:50:00'::TIMESTAMP,
        tsrange(now()::timestamp, now()::timestamp + (interval '7d'))
    );
volkanunsal commented 3 years ago

when there is no COUNT or UNTIL definied in the RRULE the expected behavior should be that the event is repeated infinitly.

Ideally, yes. But that's not feasible in the current implementation. So either UNTIL or COUNT must be present.

MrFastDie commented 3 years ago

Could you point that out in the README then? Cause it's kinda ignoring the https://tools.ietf.org/html/rfc2445 with this restriction.

volkanunsal commented 3 years ago

Sure. Do you want to submit a PR for it?

MrFastDie commented 3 years ago

Yea can do tomorrow