Block Personal Events
What it does: Blocks any event whose title or description contains the word "personal", preventing it from appearing in the synced calendar.
Use case: Useful when sharing a work calendar with colleagues or tools, but you want to keep personal appointments private.
function gate(event: GateEvent): GateResult {
if (event.matches('personal')) {
return { pass: false, reason: 'Blocked personal event' };
}
return { pass: true };
}
How It Works
The matches() helper performs a case-insensitive search across both the event title and description. If either field contains "personal", the event is blocked with a descriptive reason. All other events pass through unchanged.
Customization
Block multiple keywords:
function gate(event: GateEvent): GateResult {
if (event.matches('personal') || event.matches('private') || event.matches('vacation')) {
return { pass: false, reason: 'Blocked personal event' };
}
return { pass: true };
}
Case-insensitive by default — change the keyword to suit your naming:
function gate(event: GateEvent): GateResult {
if (event.matches('OOO') || event.matches('out of office')) {
return { pass: false, reason: 'Blocked out-of-office event' };
}
return { pass: true };
}
Related Recipes
- Block by Keyword -- Block events matching any set of keywords
- Redact Event Titles -- Keep the event but replace the title with generic text