MCPcopy Create free account
hub / github.com/codecombat/codecombat / convertEvent

Function convertEvent

app/core/social-handlers/GoogleCalendarHandler.js:4–31  ·  view source on GitHub ↗
(e, timeZone)

Source from the content-addressed store, hash-verified

2const SCOPE = 'https://www.googleapis.com/auth/calendar'
3
4const convertEvent = (e, timeZone) => {
5 const description = e.meetingLink ? `Join Meeting: ${e.meetingLink}` : ''
6 const res = {
7 summary: e.name,
8 start: {
9 dateTime: e.startDate,
10 timeZone
11 },
12 end: {
13 dateTime: e.endDate,
14 timeZone
15 },
16 recurrence: [
17 e.rrule.replace(/DTSTART:.*?\n/, '')
18 ],
19 // TODO: if any of students also has email?
20 attendees: (e.gcEmails || []).map(e => { return { email: e } }),
21 reminders: {
22 useDefault: false,
23 overrides: [
24 { method: 'email', minutes: 24 * 60 },
25 { method: 'popup', minutes: 10 }
26 ]
27 },
28 description
29 }
30 return res
31}
32
33const GoogleCalendarAPIHandler = class GoogleCalendarAPIHandler extends CocoClass {
34 constructor () {

Callers 1

funMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected