pages/fullcalendar-main/packages/moment-timezone/README.md
2024-03-06 14:33:17 +01:00

1 KiB

FullCalendar Moment Timezone Plugin

Enhanced named time zone functionality with Moment Timezone

Installation

First, ensure Moment Timezone is installed:

npm install moment-timezone

Then, install the FullCalendar core package, the Moment Timezone plugin, and any other plugins (like daygrid):

npm install @fullcalendar/core @fullcalendar/moment-timezone @fullcalendar/daygrid

Usage

Instantiate a Calendar with the necessary plugin:

import { Calendar } from '@fullcalendar/core'
import momentTimezonePlugin from '@fullcalendar/moment-timezone'
import dayGridPlugin from '@fullcalendar/daygrid'

const calendarEl = document.getElementById('calendar')
const calendar = new Calendar(calendarEl, {
  plugins: [
    momentTimezonePlugin,
    dayGridPlugin
  ],
  initialView: 'dayGridMonth',
  timeZone: 'America/New_York' // enhance named time zones
})

calendar.render()