npm.io
6.1.22 • Published 3 weeks ago

@fullcalendar/timegrid

Licence
MIT
Version
6.1.22
Deps
1
Size
233 kB
Vulns
0
Weekly
0
Stars
20.7K

FullCalendar Time Grid Plugin

This package is for FullCalendar v6. The current version is v7, where @fullcalendar/timegrid is no longer a separate package. With v7, don't install @fullcalendar/timegrid or @fullcalendar/core, and don't downgrade to v6: import the plugin from your framework's v7 package instead, e.g. import timeGridPlugin from '@fullcalendar/react/timegrid'. See the upgrade guide.

Display events on time slots

Installation

Install the necessary packages:

npm install @fullcalendar/core @fullcalendar/timegrid

Usage

Instantiate a Calendar with the necessary plugin:

import { Calendar } from '@fullcalendar/core'
import timeGridPlugin from '@fullcalendar/timegrid'

const calendarEl = document.getElementById('calendar')
const calendar = new Calendar(calendarEl, {
  plugins: [timeGridPlugin],
  initialView: 'timeGridWeek',
  events: [
    { title: 'Meeting', start: new Date() }
  ]
})

calendar.render()

Keywords