UNPKG

930 BMarkdownView Raw
1
2# FullCalendar Core
3
4FullCalendar core package for rendering a calendar
5
6## Installation
7
8This package is never used alone. Use it with least one plugin (like [daygrid](https://fullcalendar.io/docs/month-view)):
9
10```sh
11npm install @fullcalendar/core @fullcalendar/daygrid
12```
13
14## Usage
15
16First, 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
24Then, instantiate a Calendar object with [options](https://fullcalendar.io/docs#toc) and call its `render` method:
25
26```js
27import { Calendar } from '@fullcalendar/core'
28import dayGridPlugin from '@fullcalendar/daygrid'
29
30const calendarEl = document.getElementById('calendar')
31const 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
43calendar.render()
44```