Multi-Timezone Display

The event calendar works with local times by default, but ships with support for changing the timezone. The conversions and correct output relies on either of these three external libraries: luxon, moment-timezone and day.js. For installing and using these libraries check out this guide.

There are two angles regarding timezones:

  • dataTimezone - the calendar expects this format and returns this format. It is 'local' by default if the date-times don't contain any timezone information.

It can be set globally on the calendar using the dataTimezone option, or specifically for the event using the timezone property of the event data.

  • displayTimezone - the calendar displays the events in this timezone. The date-times will be converted from the dataTimezone and displayed accordingly. It is 'local' by default
Enable switching the timezone in the UI?  Learn how to dynamically change timezones →
Get started with this example

Demo

Data timezone is:

Display timezone is:

The local timezone your browser is in:

import { dayjsTimezone } from '@mobiscroll/react';
import dayjs from 'dayjs';
import timezone from 'dayjs/plugin/timezone';
import utc from 'dayjs/plugin/utc';

// Extend Day.js with UTC and timezone plugins
dayjs.extend(utc);
dayjs.extend(timezone);
// Setup Mobiscroll Day.js plugin
dayjsTimezone.dayjs = dayjs;

function App() {
    return <Eventcalendar
        dataTimezone='utc'
        displayTimezone='local'
        timezonePlugin={dayjsTimezone}
        view={{ agenda: { type: 'week' }}}
    />
}
Show Agenda events in any timezone — configure data and display timezones, then add a UI timezone picker to let users switch views.

Duplicate Session

You have signed in on a different machine. To keep everything in sync, you have been signed out of this session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.

Duplicate Session

We noticed you are logged in on a different machine and have closed your old session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.