1 |
|
2 | # FullCalendar Core
|
3 |
|
4 | FullCalendar core package for rendering a calendar
|
5 |
|
6 | ## Installation
|
7 |
|
8 | This package is never used alone. Use it with least one plugin (like [daygrid](https://fullcalendar.io/docs/month-view)):
|
9 |
|
10 | ```sh
|
11 | npm install @fullcalendar/core @fullcalendar/daygrid
|
12 | ```
|
13 |
|
14 | ## Usage
|
15 |
|
16 | First, ensure there's a DOM element for your calendar to render into:
|
17 |
|
18 | ```html
|
19 | <body>
|
20 | <div id='calendar'></div>
|
21 | </body>
|
22 | ```
|
23 |
|
24 | Then, instantiate a Calendar object with [options](https://fullcalendar.io/docs#toc) and call its `render` method:
|
25 |
|
26 | ```js
|
27 | import { Calendar } from '@fullcalendar/core'
|
28 | import dayGridPlugin from '@fullcalendar/daygrid'
|
29 |
|
30 | const calendarEl = document.getElementById('calendar')
|
31 | const calendar = new Calendar(calendarEl, {
|
32 | plugins: [
|
33 | dayGridPlugin
|
34 | // any other plugins
|
35 | ],
|
36 | initialView: 'dayGridMonth',
|
37 | weekends: false,
|
38 | events: [
|
39 | { title: 'Meeting', start: new Date() }
|
40 | ]
|
41 | })
|
42 |
|
43 | calendar.render()
|
44 | ```
|