Skip to content

Commit

Permalink
Tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
volkanunsal committed May 8, 2019
1 parent 0205894 commit 2140091
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions postgres-rrule.sql
Original file line number Diff line number Diff line change
Expand Up @@ -659,17 +659,17 @@ RETURNS SETOF TIMESTAMP AS $$
FROM _rrule.occurrences("rruleset", tsrange("when", NULL));
$$ LANGUAGE SQL STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION _rrule.contains_timestamp(_rrule.rruleset, TIMESTAMP)
CREATE OR REPLACE FUNCTION _rrule.contains_timestamp(_rrule.RRULESET, TIMESTAMP)
RETURNS BOOLEAN AS $$
DECLARE
isEmpty boolean;
inSet boolean;
BEGIN
SELECT COUNT(*) > 0
INTO isEmpty
INTO inSet
FROM _rrule.after($1, $2 - INTERVAL '1 month') "ts"
WHERE "ts"::date = $2::date;

RETURN isEmpty;
RETURN inSet;
END;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION _rrule.jsonb_to_rrule("input" jsonb)
Expand Down
8 changes: 4 additions & 4 deletions src/functions/0214-contains_timestamp.sql
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
CREATE OR REPLACE FUNCTION _rrule.contains_timestamp(_rrule.rruleset, TIMESTAMP)
CREATE OR REPLACE FUNCTION _rrule.contains_timestamp(_rrule.RRULESET, TIMESTAMP)
RETURNS BOOLEAN AS $$
DECLARE
isEmpty boolean;
inSet boolean;
BEGIN
SELECT COUNT(*) > 0
INTO isEmpty
INTO inSet
FROM _rrule.after($1, $2 - INTERVAL '1 month') "ts"
WHERE "ts"::date = $2::date;

RETURN isEmpty;
RETURN inSet;
END;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;

0 comments on commit 2140091

Please sign in to comment.