1 |
|
2 | # FullCalendar Time Grid Plugin
|
3 |
|
4 | Display events on time slots
|
5 |
|
6 | ## Installation
|
7 |
|
8 | Install the necessary packages:
|
9 |
|
10 | ```sh
|
11 | npm install @fullcalendar/core @fullcalendar/timegrid
|
12 | ```
|
13 |
|
14 | ## Usage
|
15 |
|
16 | Instantiate a Calendar with the necessary plugin:
|
17 |
|
18 | ```js
|
19 | import { Calendar } from '@fullcalendar/core'
|
20 | import timeGridPlugin from '@fullcalendar/timegrid'
|
21 |
|
22 | const calendarEl = document.getElementById('calendar')
|
23 | const calendar = new Calendar(calendarEl, {
|
24 | plugins: [timeGridPlugin],
|
25 | initialView: 'timeGridWeek',
|
26 | events: [
|
27 | { title: 'Meeting', start: new Date() }
|
28 | ]
|
29 | })
|
30 |
|
31 | calendar.render()
|
32 | ```
|