Skip to main content

Filter Cancelled Events

What it does: Blocks any event with a cancelled status so that cancellations in the source calendar do not appear in the synced calendar.

Use case: Keep a shared or aggregated calendar tidy by automatically excluding meetings that have been cancelled.

function gate(event: GateEvent): GateResult {
if (event.status === 'cancelled') {
return { pass: false, reason: 'Cancelled event' };
}
return { pass: true };
}

How It Works

The status property reflects the event's confirmation state in the source calendar. It can be 'confirmed', 'tentative', or 'cancelled'. By checking for 'cancelled' and returning pass: false, you prevent those events from ever reaching the target calendar.

Customization

Also filter tentative events (only sync confirmed meetings):

function gate(event: GateEvent): GateResult {
if (event.status === 'cancelled' || event.status === 'tentative') {
return { pass: false, reason: `Event status is ${event.status}` };
}
return { pass: true };
}

Only sync confirmed events — explicit allowlist approach:

function gate(event: GateEvent): GateResult {
if (event.status !== 'confirmed') {
return { pass: false, reason: 'Only confirmed events are synced' };
}
return { pass: true };
}