You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function that consumes an rruleset and returns occurences passes a tsrange instance of (,) by default, which ignores dtend set in in the rruleset.
The following function fixes this:
CREATE OR REPLACEFUNCTION_rrule.occurrences("rruleset"_rrule.RRULESET)
RETURNS SETOF TIMESTAMPAS $$
DECLARE
local_rrule _rrule.rrule :=rruleset.rrule;
tsrange_start TIMESTAMP :=rruleset.dtstart;
tsrange_end TIMESTAMP;
calculated_range TSRANGE;
BEGIN
IF rruleset.dtendIS NOT NULL THEN
tsrange_end :=rruleset.dtend;
ELSIF local_rrule.untilIS NOT NULL THEN
tsrange_end =local_rrule.until;
END IF;
IF tsrange_end IS NOT NULL THEN
calculated_range = tsrange(tsrange_start, tsrange_end);
ELSE
calculated_range = tsrange(tsrange_start);
END IF;
RETURN QUERY SELECT*FROM_rrule.occurrences("rruleset", calculated_range);
END;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
The text was updated successfully, but these errors were encountered:
The function that consumes an
rruleset
and returns occurences passes atsrange
instance of(,)
by default, which ignoresdtend
set in in therruleset
.The following function fixes this:
The text was updated successfully, but these errors were encountered: