@fullcalendar/google-calendar 6.0.0-beta.3 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -3
- package/index.global.js +2 -2
- package/index.global.min.js +2 -2
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -1,8 +1,36 @@
|
|
|
1
1
|
|
|
2
2
|
# FullCalendar Google Calendar Plugin
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
Display events from a public [Google Calendar feed](https://support.google.com/calendar/answer/37648?hl=en)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## Installation
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Install the FullCalendar core package, the Google Calendar plugin, and any other plugins (like [daygrid](https://fullcalendar.io/docs/month-view)):
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install @fullcalendar/core @fullcalendar/google-calendar @fullcalendar/daygrid
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
Instantiate a Calendar with the necessary plugin:
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
import { Calendar } from '@fullcalendar/core'
|
|
20
|
+
import googleCalendarPlugin from '@fullcalendar/google-calendar'
|
|
21
|
+
import dayGridPlugin from '@fullcalendar/daygrid'
|
|
22
|
+
|
|
23
|
+
const calendarEl = document.getElementById('calendar')
|
|
24
|
+
const calendar = new Calendar(calendarEl, {
|
|
25
|
+
plugins: [
|
|
26
|
+
googleCalendarPlugin,
|
|
27
|
+
dayGridPlugin
|
|
28
|
+
],
|
|
29
|
+
initialView: 'dayGridMonth',
|
|
30
|
+
events: {
|
|
31
|
+
googleCalendarId: 'abcd1234@group.calendar.google.com'
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
calendar.render()
|
|
36
|
+
```
|
package/index.global.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
FullCalendar Google Calendar Plugin v6.0.0
|
|
3
|
-
Docs & License: https://fullcalendar.io/
|
|
2
|
+
FullCalendar Google Calendar Plugin v6.0.0
|
|
3
|
+
Docs & License: https://fullcalendar.io/docs/google-calendar
|
|
4
4
|
(c) 2022 Adam Shaw
|
|
5
5
|
*/
|
|
6
6
|
FullCalendar.GoogleCalendar = (function (exports, internal, core) {
|
package/index.global.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
FullCalendar Google Calendar Plugin v6.0.0
|
|
3
|
-
Docs & License: https://fullcalendar.io/
|
|
2
|
+
FullCalendar Google Calendar Plugin v6.0.0
|
|
3
|
+
Docs & License: https://fullcalendar.io/docs/google-calendar
|
|
4
4
|
(c) 2022 Adam Shaw
|
|
5
5
|
*/
|
|
6
6
|
FullCalendar.GoogleCalendar=function(e,a,t){"use strict";const n={parseMeta(e){let{googleCalendarId:a}=e;return!a&&e.url&&(a=function(e){let a;if(/^[^/]+@([^/.]+\.)*(google|googlemail|gmail)\.com$/.test(e))return e;if((a=/^https:\/\/www.googleapis.com\/calendar\/v3\/calendars\/([^/]*)/.exec(e))||(a=/^https?:\/\/www.google.com\/calendar\/feeds\/([^/]*)/.exec(e)))return decodeURIComponent(a[1]);return null}(e.url)),a?{googleCalendarId:a,googleCalendarApiKey:e.googleCalendarApiKey,googleCalendarApiBase:e.googleCalendarApiBase,extraParams:e.extraParams}:null},fetch(e,n,r){let{dateEnv:o,options:l}=e.context,s=e.eventSource.meta,i=s.googleCalendarApiKey||l.googleCalendarApiKey;if(i){let l=function(e){let a=e.googleCalendarApiBase;a||(a="https://www.googleapis.com/calendar/v3/calendars");return a+"/"+encodeURIComponent(e.googleCalendarId)+"/events"}(s),{extraParams:d}=s,g="function"==typeof d?d():d,c=function(e,t,n,r){let o,l,s;r.canComputeOffset?(l=r.formatIso(e.start),s=r.formatIso(e.end)):(l=a.addDays(e.start,-1).toISOString(),s=a.addDays(e.end,1).toISOString());o=Object.assign(Object.assign({},n||{}),{key:t,timeMin:l,timeMax:s,singleEvents:!0,maxResults:9999}),"local"!==r.timeZone&&(o.timeZone=r.timeZone);return o}(e.range,i,g,o);return a.requestJson("GET",l,c).then(([e,a])=>{var o,l;e.error?r(new t.JsonRequestError("Google Calendar API: "+e.error.message,a)):n({rawEvents:(o=e.items,l=c.timeZone,o.map(e=>function(e,a){let t=e.htmlLink||null;t&&a&&(t=function(e,a){return e.replace(/(\?.*?)?(#|$)/,(e,t,n)=>(t?t+"&":"?")+a+n)}(t,"ctz="+a));return{id:e.id,title:e.summary,start:e.start.dateTime||e.start.date,end:e.end.dateTime||e.end.date,url:t,location:e.location,description:e.description,attachments:e.attachments||[],extendedProps:(e.extendedProperties||{}).shared||{}}}(e,l))),response:a})},r)}r(new Error("Specify a googleCalendarApiKey. See https://fullcalendar.io/docs/google-calendar"))}};const r={googleCalendarApiKey:String},o={googleCalendarApiKey:String,googleCalendarId:String,googleCalendarApiBase:String,extraParams:a.identity};var l=t.createPlugin({name:"@fullcalendar/google-calendar",eventSourceDefs:[n],optionRefiners:r,eventSourceRefiners:o});return a.globalPlugins.push(l),e.default=l,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar.Internal,FullCalendar);
|
package/package.json
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullcalendar/google-calendar",
|
|
3
|
-
"version": "6.0.0
|
|
3
|
+
"version": "6.0.0",
|
|
4
|
+
"title": "FullCalendar Google Calendar Plugin",
|
|
5
|
+
"description": "Display events from a public Google Calendar feed",
|
|
6
|
+
"homepage": "https://fullcalendar.io/docs/google-calendar",
|
|
4
7
|
"keywords": [
|
|
5
8
|
"calendar",
|
|
6
9
|
"event",
|
|
7
|
-
"full-sized"
|
|
10
|
+
"full-sized",
|
|
11
|
+
"fullcalendar",
|
|
12
|
+
"google-calendar"
|
|
8
13
|
],
|
|
9
|
-
"
|
|
10
|
-
|
|
14
|
+
"peerDependencies": {
|
|
15
|
+
"@fullcalendar/core": "~6.0.0"
|
|
16
|
+
},
|
|
17
|
+
"type": "module",
|
|
11
18
|
"bugs": "https://fullcalendar.io/reporting-bugs",
|
|
12
19
|
"repository": {
|
|
13
20
|
"type": "git",
|
|
14
21
|
"url": "https://github.com/fullcalendar/fullcalendar.git",
|
|
15
|
-
"homepage": "https://github.com/fullcalendar/fullcalendar",
|
|
16
22
|
"directory": "packages/google-calendar"
|
|
17
23
|
},
|
|
18
24
|
"license": "MIT",
|
|
@@ -22,17 +28,11 @@
|
|
|
22
28
|
"url": "http://arshaw.com/"
|
|
23
29
|
},
|
|
24
30
|
"copyright": "2022 Adam Shaw",
|
|
25
|
-
"type": "module",
|
|
26
|
-
"title": "FullCalendar Google Calendar Plugin",
|
|
27
|
-
"description": "Fetch events from a public Google Calendar feed",
|
|
28
|
-
"peerDependencies": {
|
|
29
|
-
"@fullcalendar/core": "6.0.0-beta.3"
|
|
30
|
-
},
|
|
31
31
|
"main": "./index.cjs",
|
|
32
32
|
"module": "./index.js",
|
|
33
33
|
"types": "./index.d.ts",
|
|
34
34
|
"unpkg": "./index.global.min.js",
|
|
35
|
-
"
|
|
35
|
+
"jsdelivr": "./index.global.min.js",
|
|
36
36
|
"exports": {
|
|
37
37
|
"./package.json": "./package.json",
|
|
38
38
|
"./index.cjs": "./index.cjs",
|