@fullcalendar/moment 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 +35 -3
- package/index.global.js +2 -2
- package/index.global.min.js +2 -2
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -1,8 +1,40 @@
|
|
|
1
1
|
|
|
2
2
|
# FullCalendar Moment Plugin
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
Enhanced date formatting and conversion with [Moment](https://momentjs.com/)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## Installation
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
First, ensure Moment is installed:
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install moment
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Then, install the FullCalendar core package, the Moment plugin, and any other plugins (like [daygrid](https://fullcalendar.io/docs/month-view)):
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm install @fullcalendar/core @fullcalendar/moment @fullcalendar/daygrid
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
Instantiate a Calendar with the necessary plugin:
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { Calendar } from '@fullcalendar/core'
|
|
26
|
+
import momentPlugin from '@fullcalendar/moment'
|
|
27
|
+
import dayGridPlugin from '@fullcalendar/daygrid'
|
|
28
|
+
|
|
29
|
+
const calendarEl = document.getElementById('calendar')
|
|
30
|
+
const calendar = new Calendar(calendarEl, {
|
|
31
|
+
plugins: [
|
|
32
|
+
momentPlugin,
|
|
33
|
+
dayGridPlugin
|
|
34
|
+
],
|
|
35
|
+
initialView: 'dayGridMonth',
|
|
36
|
+
titleFormat: 'MMMM D, YYYY' // use Moment format strings
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
calendar.render()
|
|
40
|
+
```
|
package/index.global.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
FullCalendar Moment Plugin v6.0.0
|
|
3
|
-
Docs & License: https://fullcalendar.io/
|
|
2
|
+
FullCalendar Moment Plugin v6.0.0
|
|
3
|
+
Docs & License: https://fullcalendar.io/docs/moment-plugin
|
|
4
4
|
(c) 2022 Adam Shaw
|
|
5
5
|
*/
|
|
6
6
|
FullCalendar.Moment = (function (exports, internal, core, moment) {
|
package/index.global.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
FullCalendar Moment Plugin v6.0.0
|
|
3
|
-
Docs & License: https://fullcalendar.io/
|
|
2
|
+
FullCalendar Moment Plugin v6.0.0
|
|
3
|
+
Docs & License: https://fullcalendar.io/docs/moment-plugin
|
|
4
4
|
(c) 2022 Adam Shaw
|
|
5
5
|
*/
|
|
6
6
|
FullCalendar.Moment=function(e,t,l,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}var r=a(n);function u(e,t,l,n){let a;return"local"===t?a=r.default(e):"UTC"===t?a=r.default.utc(e):r.default.tz?a=r.default.tz(e,t):(a=r.default.utc(e),null!=l&&a.utcOffset(l)),a.locale(n),a}function o(e){return t=>t?e.format(t):""}var d=l.createPlugin({name:"@fullcalendar/moment",cmdFormatter:function(e,t){let l=function e(t){let l=t.match(/^(.*?)\{(.*)\}(.*)$/);if(l){let t=e(l[2]);return{head:l[1],middle:t,tail:l[3],whole:l[1]+t.whole+l[3]}}return{head:null,middle:null,tail:null,whole:t}}(e);if(t.end){let e=u(t.start.array,t.timeZone,t.start.timeZoneOffset,t.localeCodes[0]),n=u(t.end.array,t.timeZone,t.end.timeZoneOffset,t.localeCodes[0]);return function e(t,l,n,a){if(t.middle){let r=l(t.head),u=e(t.middle,l,n,a),o=l(t.tail),d=n(t.head),i=e(t.middle,l,n,a),f=n(t.tail);if(r===d&&o===f)return r+(u===i?u:u+a+i)+o}let r=l(t.whole),u=n(t.whole);if(r===u)return r;return r+a+u}(l,o(e),o(n),t.defaultSeparator)}return u(t.date.array,t.timeZone,t.date.timeZoneOffset,t.localeCodes[0]).format(l.whole)}});return t.globalPlugins.push(d),e.default=d,e.toMoment=function(e,l){if(!(l instanceof t.CalendarImpl))throw new Error("must supply a CalendarApi instance");let{dateEnv:n}=l.getCurrentData();return u(e,n.timeZone,null,n.locale.codes[0])},e.toMomentDuration=function(e){return r.default.duration(e)},Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar.Internal,FullCalendar,moment);
|
package/package.json
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullcalendar/moment",
|
|
3
|
-
"version": "6.0.0
|
|
3
|
+
"version": "6.0.0",
|
|
4
|
+
"title": "FullCalendar Moment Plugin",
|
|
5
|
+
"description": "Enhanced date formatting and conversion with Moment",
|
|
4
6
|
"keywords": [
|
|
5
7
|
"calendar",
|
|
6
8
|
"event",
|
|
7
|
-
"full-sized"
|
|
9
|
+
"full-sized",
|
|
10
|
+
"fullcalendar",
|
|
11
|
+
"moment"
|
|
8
12
|
],
|
|
9
|
-
"homepage": "https://fullcalendar.io/",
|
|
10
|
-
"
|
|
13
|
+
"homepage": "https://fullcalendar.io/docs/moment-plugin",
|
|
14
|
+
"peerDependencies": {
|
|
15
|
+
"@fullcalendar/core": "~6.0.0",
|
|
16
|
+
"moment": "^2.29.1"
|
|
17
|
+
},
|
|
18
|
+
"type": "module",
|
|
11
19
|
"bugs": "https://fullcalendar.io/reporting-bugs",
|
|
12
20
|
"repository": {
|
|
13
21
|
"type": "git",
|
|
14
22
|
"url": "https://github.com/fullcalendar/fullcalendar.git",
|
|
15
|
-
"homepage": "https://github.com/fullcalendar/fullcalendar",
|
|
16
23
|
"directory": "packages/moment"
|
|
17
24
|
},
|
|
18
25
|
"license": "MIT",
|
|
@@ -22,18 +29,11 @@
|
|
|
22
29
|
"url": "http://arshaw.com/"
|
|
23
30
|
},
|
|
24
31
|
"copyright": "2022 Adam Shaw",
|
|
25
|
-
"type": "module",
|
|
26
|
-
"title": "FullCalendar Moment Plugin",
|
|
27
|
-
"description": "A connector to the MomentJS date library",
|
|
28
|
-
"peerDependencies": {
|
|
29
|
-
"@fullcalendar/core": "6.0.0-beta.3",
|
|
30
|
-
"moment": "^2.29.1"
|
|
31
|
-
},
|
|
32
32
|
"main": "./index.cjs",
|
|
33
33
|
"module": "./index.js",
|
|
34
34
|
"types": "./index.d.ts",
|
|
35
35
|
"unpkg": "./index.global.min.js",
|
|
36
|
-
"
|
|
36
|
+
"jsdelivr": "./index.global.min.js",
|
|
37
37
|
"exports": {
|
|
38
38
|
"./package.json": "./package.json",
|
|
39
39
|
"./index.cjs": "./index.cjs",
|