-
-
Notifications
You must be signed in to change notification settings - Fork 204
/
Copy pathfilters.gs
42 lines (41 loc) · 1.43 KB
/
filters.gs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Filters for calendar events based on ical properties (RFC 5545).
Define each filter with the following structure and add them to the var filters array:
{
parameter: "property", // Event property to filter by (e.g., "summary", "categories", "dtend", "dtstart").
type: "include/exclude", // Whether to include or exclude events matching the criteria.
comparison: "method", // Comparison method: "equals", "begins with", "contains", "regex", "<", ">".
// Note: "<", ">" only apply for date/time properties.
criterias: ["values"], // Array of values or patterns for comparison.
offset: number // (Optional) For date/time properties, specify an offset in days.
}
*/
var filters = [];
/* Examples:
var filters = [
{
parameter: "summary", // Exclude events whose summary starts with "Pending:" or contains "cancelled".
type: "exclude",
comparison: "regex",
criterias: ["^Pending:", "cancelled"]
},
{
parameter: "categories", // Include only events categorized as "Meetings".
type: "include",
comparison: "equals",
criterias: ["Meetings"]
},
{
parameter: "dtend", // Reproduce the old onlyFutureEvents behaviour.
type: "include",
comparison: ">",
offset: 0
},
{
parameter: "dtstart", // Exclude events starting more than 14 days from now.
type: "exclude",
comparison: ">",
offset: 14
}
];
*/