1title: Calendar
2type: jig.calendar
3
4header:
5 type: component.jig-header
6 options:
7 height: small
8 children:
9 type: component.image
10 options:
11 source:
12 uri: https://support.content.office.net/en-us/media/f1c4b693-4670-4e7a-8102-bbf1749e83fe.jpg
13
14
15onFocus:
16 type: action.sync-entities
17 options:
18 provider: DATA_PROVIDER_REST
19 entities:
20 - entity: calendarEvents
21 function: get-calendar-event-list
22 functionParameters:
23 accessToken: microsoft.OAuth
24 calendarId: =@ctx.jig.inputs.calId
25 $filter: ="start/dateTime ge '" & $fromMillis($millis()-86400000) & "' and end/dateTime le '" & $fromMillis($millis()+5184000000) & "'"
26
27onRefresh:
28 type: action.sync-entities
29 options:
30 provider: DATA_PROVIDER_REST
31 entities:
32 - entity: calendarEvents
33 function: get-calendar-event-list
34 functionParameters:
35 accessToken: microsoft.OAuth
36 calendarId: =@ctx.jig.inputs.calId
37 $filter: ="start/dateTime ge '" & $fromMillis($millis()-86400000) & "' and end/dateTime le '" & $fromMillis($millis()+5184000000) & "'"
38
39datasources:
40 calendarEvents:
41 type: datasource.sqlite
42 options:
43 provider: DATA_PROVIDER_LOCAL
44 entities:
45 - entity: calendarEvents
46 jsonProperties:
47 - attendees
48 query: |
49 SELECT id,
50 '$.id' as eventId,
51 '$.createdDateTime',
52 '$.lastModifiedDateTime',
53 '$.originalStartTimeZone',
54 '$.originalEndTimeZone',
55 '$.reminderMinutesBeforeStart',
56 '$.isReminderOn',
57 '$.hasAttachments',
58 '$.subject',
59 '$.bodyPreview',
60 '$.importance',
61 '$.sensitivity',
62 '$.isCancelled',
63 '$.isOrganizer',
64 '$.showAs',
65 '$.webLink',
66 json_extract(Data, '$.onlineMeetingUrl.joinUrl') as onlineMeetingUrl,
67 '$.isOnlineMeeting',
68 '$.onlineMeetingProvider',
69 '$.onlineMeeting',
70 json_extract(Data, '$.body.contentType') as bodyContentType,
71 json_extract(Data, '$.body.content') as bodyContent,
72 json_extract(Data, '$.start.dateTime') || 'Z' as startTime,
73 json_extract(Data, '$.end.dateTime') || 'Z' as endTime,
74 '$.location',
75 '$.attendees',
76 '$.organizer'
77 FROM [calendarEvents]
78
79data: =@ctx.datasources.calendarEvents
80item:
81 type: component.event
82 options:
83 from: =@ctx.current.item.startTime
84 to: =@ctx.current.item.endTime
85 title: =@ctx.current.item.subject
86 location: "='Importance: ' & @ctx.current.item.importance"
87 description: =@ctx.current.item.bodyPreview
88 people: "=@ctx.current.item.attendees.{'fullName': emailAddress.address, 'email': emailAddress.address}"
89 buttonTitle: View Event Details
90 onPress:
91 type: action.go-to
92 options:
93 linkTo: view-calendar-event-details-w
94 parameters:
95 eventId: =@ctx.current.item.eventId
96 evtFrom: =@ctx.current.item.startTime
97 evtTo: =@ctx.current.item.endTime
98 bodyContent: =@ctx.current.item.bodyContent
99 summary: =@ctx.current.item.bodyPreview
100 subject: =@ctx.current.item.subject
101 onlineMeetingUrl: =@ctx.current.item.onlineMeetingUrl
102 isOnlineMeeting: =@ctx.current.item.isOnlineMeeting
103 bodyPreview: =@ctx.current.item.bodyPreview
104 attendees: =@ctx.current.item.attendees
105 onlineMeetingProvider: =@ctx.current.item.onlineMeetingProvider
106
107actions:
108 - children:
109 - type: action.go-to
110 options:
111 title: Create New Event
112 linkTo: create-calendar-event