Skip to content

Commit 9e3fdf8

Browse files
committed
Update clear-all-events
Signed-off-by: Alex Ivanov <ai@contributor.pw>
1 parent 99dc027 commit 9e3fdf8

File tree

3 files changed

+34
-12
lines changed

3 files changed

+34
-12
lines changed

snippets/calendar/clear-all-events/index.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
/* exported run */
2-
3-
/**
4-
*
5-
*/
6-
function run() {
7-
const calendar = CalendarApp.getCalendarById(
8-
'1fq7choqdctaal2sk5i5du43qc@group.calendar.google.com'
9-
);
10-
console.log(clearAllEvents_(calendar));
11-
}
12-
131
/**
142
*
153
* @param {GoogleAppsScript.Calendar.Calendar} calendar
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: 'To clear all events from a Google Calendar'
3+
date: '2021-03-29'
4+
description: 'Loops through all events and removes them. Demonstrates differences in event types.'
5+
tags: ['calendar']
6+
categories: ['snippets']
7+
---
8+
9+
{{< toc >}}
10+
11+
## Clear all events from a Calendar
12+
13+
### Snippet
14+
15+
- {{< externalLink >}}
16+
- {{< commentLink >}}
17+
- {{< scrvizLink >}}
18+
19+
{{< codeFromFile "index.js" >}}
20+
21+
### Run it
22+
23+
{{< codeFromFile "run.js" >}}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* global clearAllEvents_ */
2+
3+
/**
4+
*
5+
*/
6+
function run() {
7+
const calendar = CalendarApp.getCalendarById(
8+
'1fq7choqdctaal2sk5i5du43qc@group.calendar.google.com'
9+
);
10+
console.log(clearAllEvents_(calendar));
11+
}

0 commit comments

Comments
 (0)