Localization & Timezones
Set the display timezone, 12h/24h clock, week start day, and translate UI labels in the dash-mui-scheduler calendar.
Localization & Timezones
The scheduler can render the same events for users in different timezones and locales without ever touching the event data itself. Four knobs cover almost everything:
displayTimezone— which timezone the grid is drawn in (render-only).preferences.ampm— 12-hour vs 24-hour clock.preferences.weekStartsOn— which weekday a week begins on.localeText— overrides for individual UI label strings.
The most important idea on this page is the data boundary: an event's start / end are ISO strings that you own. Localization changes how those times are displayed, not what they are.
Display timezone
displayTimezone controls the timezone the calendar grid renders in. It accepts an IANA timezone name like "America/New_York" or "Asia/Tokyo", or one of the special values:
| Value | Meaning |
|---|---|
"default" | The component's default behavior (the initial value) |
"UTC" | Render everything in UTC |
"locale" | Use the browser's local timezone |
| IANA name | Render in that specific zone, e.g. "Europe/Paris" |
Changing displayTimezone only changes where event blocks are drawn on the grid. It does not rewrite your events. The ISO strings you pass in stay exactly as they are, and the array the component writes back keeps the same wall-clock / UTC strings. Think of it as a viewport over fixed instants.
How the strings are interpreted matters here:
"2024-01-17T18:00:00Z"— the trailingZmeans UTC. It refers to one fixed
instant, so it lands at different wall-clock positions in New York vs Tokyo.
"2024-01-15T09:00:00"— noZis a wall-clock time with no zone attached.
The example below renders one shared list of events in two calendars — the only difference is displayTimezone. Note how the "Release window (UTC)" event (which uses a Z suffix) shifts between the two grids, while the rest stay put.
# File: docs/localization/timezones.py
from dash import html
import dash_mantine_components as dmc
import dash_mui_scheduler as dms
# One shared set of events. Each `start`/`end` is an ISO string.
# These carry no trailing "Z", so they are wall-clock times — the same
# instant the component then re-renders in whatever displayTimezone is set.
events = [
{
"id": "1",
"title": "Morning sync",
"start": "2024-01-15T09:00:00",
"end": "2024-01-15T10:00:00",
"color": "blue",
},
{
"id": "2",
"title": "Design review",
"start": "2024-01-16T13:00:00",
"end": "2024-01-16T14:30:00",
"color": "purple",
},
{
"id": "3",
"title": "Release window (UTC)",
"start": "2024-01-17T18:00:00Z",
"end": "2024-01-17T19:00:00Z",
"color": "green",
},
]
# Two calendars, identical events, different `displayTimezone`.
# displayTimezone is render-only: it shifts where blocks appear on the grid,
# but the underlying event data (the ISO strings above) never changes.
component = dmc.Stack(
[
dmc.Text("New York (America/New_York)", fw=600, size="sm"),
dms.EventCalendar(
id="localization-tz-ny-cal",
events=events,
defaultView="week",
defaultVisibleDate="2024-01-15",
displayTimezone="America/New_York",
height=560,
),
dmc.Text("Tokyo (Asia/Tokyo)", fw=600, size="sm"),
dms.EventCalendar(
id="localization-tz-tokyo-cal",
events=events,
defaultView="week",
defaultVisibleDate="2024-01-15",
displayTimezone="Asia/Tokyo",
height=560,
),
],
gap="sm",
)
12-hour vs 24-hour clock
The clock format lives in preferences.ampm:
ampm=True→ 12-hour clock (2:00 PM).ampm=False→ 24-hour clock (14:00).
Set it via defaultPreferences (uncontrolled, initial value) or preferences (controlled IN+OUT, also readable in a callback). Users can flip it themselves from the preferences menu unless you disable that toggle. See the Preferences page for the full preferences dict and menu config.
Week start
preferences.weekStartsOn is an integer from 0 to 6 that picks the first day of the week:
| Value | Day |
|---|---|
| 0 | Sunday |
| 1 | Monday |
| 2 | Tuesday |
| 3 | Wednesday |
| 4 | Thursday |
| 5 | Friday |
| 6 | Saturday |
The example below seeds a Monday-first, 24-hour calendar with week numbers via defaultPreferences. Because these are preferences, they apply to the week, month, and agenda layouts consistently.
# File: docs/localization/week_start.py
from dash import html
import dash_mui_scheduler as dms
events = [
{
"id": "1",
"title": "Sprint planning",
"start": "2024-01-15T09:00:00",
"end": "2024-01-15T10:30:00",
"color": "indigo",
},
{
"id": "2",
"title": "Saturday demo",
"start": "2024-01-20T11:00:00",
"end": "2024-01-20T12:00:00",
"color": "amber",
},
{
"id": "3",
"title": "Sunday on-call",
"start": "2024-01-21T08:00:00",
"end": "2024-01-21T09:00:00",
"color": "red",
},
]
# weekStartsOn (0 = Sunday … 6 = Saturday) and ampm live inside preferences.
# Here defaultPreferences seeds a Monday-first, 24-hour calendar on load.
component = html.Div(
dms.EventCalendar(
id="localization-week-start-cal",
events=events,
defaultView="week",
defaultVisibleDate="2024-01-15",
defaultPreferences={
"weekStartsOn": 1,
"ampm": False,
"showWeekends": True,
"showWeekNumber": True,
},
height=560,
)
)
Both ampm and weekStartsOn are keys inside the preferences dict — there are no top-level ampm / weekStartsOn props. Pass them through defaultPreferences={...} or the controlled preferences={...}.
Label overrides
localeText is a dict of overrides for the calendar's built-in UI label strings — button captions, menu items, placeholders, and so on. Pass it as a dict where each value replaces the default text for that key:
dms.EventCalendar(
id="my-cal",
events=events,
localeText={
"today": "Aujourd'hui",
"week": "Semaine",
"month": "Mois",
},
)
The MUI X Scheduler's locale text includes both plain strings and functions (for example, labels that format a date range). Because props cross the Dash boundary as JSON, only the string-valued keys can be overridden from Python — function-valued entries can't be passed and will fall back to their defaults. Use localeText for static caption text, not for dynamic formatters.
For full locale coverage (including the function-valued formatters), you would provide a translation at the React/JS layer. From Dash, localeText is best treated as a way to retitle the static buttons and menu items.
Timezones and the data you store
Because displayTimezone never edits your events, your storage stays predictable:
- Store events as ISO strings. Add a
Z(or an explicit offset) when a value
is a fixed UTC instant; omit it when it's a floating wall-clock time.
- An event may also carry its own
timezone(IANA) key in its dict to anchor it
to a specific zone independent of the display timezone.
- When the component writes
eventsback after a drag/create/resize, it returns
ISO strings in the same shape — so a round-trip through Dash doesn't silently re-localize your data.
The MUI X Scheduler is in beta. Timezone and locale behavior can change between releases; verify edge cases (DST boundaries, cross-zone all-day events) against your target version.
Component reference
EventCalendar props
| prop | type | description | |||||
|---|---|---|---|---|---|---|---|
id | string; optional | The id used to identify this component in Dash callbacks. | |||||
areEventsDraggable | boolean; optional | Allow drag-to-reschedule. Default True. | |||||
areEventsResizable | boolean \ | a value equal to: 'start', 'end'; optional | Allow resize (bool, or restrict to "start"/"end"). Default True. | ||||
canDragEventsFromTheOutside | boolean; optional | Allow external events to be dragged in. Default False. | |||||
canDropEventsToTheOutside | boolean; optional | Allow events to be dragged out of the calendar. Default False. | |||||
className | string; optional | CSS class applied to the wrapping div. | |||||
defaultPreferences | dict; optional | Uncontrolled initial preferences (same shape as preferences). defaultPreferences is a dict with keys: - ampm (boolean; optional) - weekStartsOn (a value equal to: 0, 1, 2, 3, 4, 5, 6; optional) - showWeekends (boolean; optional) - showWeekNumber (boolean; optional) - isSidePanelOpen (boolean; optional) - showEmptyDaysInAgenda (boolean; optional) | |||||
defaultView | a value equal to: 'day', 'week', 'month', 'agenda'; optional | Uncontrolled initial view. Default "week". | |||||
defaultVisibleDate | string; optional | Uncontrolled initial visible date (ISO string). Default today. | |||||
defaultVisibleResources | dict; optional | Uncontrolled initial resource visibility map. Default {} (all visible). | |||||
displayTimezone | string; optional | Timezone used to render events: an IANA name ("America/New_York"), or "default" / "locale" / "UTC". Render-only — events keep their own data timezone. Default "default". | |||||
eventColor | a value equal to: 'red', 'pink', 'purple', 'indigo', 'blue', 'teal', 'green', 'lime', 'amber', 'orange', 'grey'; optional | The default color palette used for all events. Overridden per resource (eventColor) and per event (color). Default "teal". | |||||
eventCreation | dict; optional | Configures event creation. False disables it; True enables it with defaults; an object sets the interaction and default duration (minutes). eventCreation is a boolean \ | dict with keys: - interaction (a value equal to: 'click', 'double-click'; optional) - duration (number; optional) | ||||
eventDialogTopOffset | number; optional | On desktop, inset the event drawer this many px from the top — e.g. set it to your fixed app header's height so the drawer lines up with a sidebar instead of covering the header. Default 0. | |||||
eventDialogVariant | a value equal to: 'drawer', 'dialog'; default 'drawer' | How the event editor is presented. "drawer" (default) restyles the built-in dialog into a responsive drawer — right-anchored on desktop, an 80%-height bottom sheet on mobile (below mobileBreakpoint), with a scrollable body and pinned header/actions. "dialog" keeps the library's default floating, draggable dialog. | |||||
events | list of dicts; optional | The events to render. Each event is a dict with at least id, title, start and end (ISO strings). This is BOTH an input and an output: the calendar writes the full array back on every create / edit / move / resize / delete. events is a list of dicts with keys: - id (string \ | number; required): Unique id (string or number). - title (string; required): Event title. - start (string; required): Start date-time, ISO string. "Z" suffix = UTC instant. - end (string; required): End date-time, ISO string. "Z" suffix = UTC instant. - description (string; optional): Optional longer description (shown in the event dialog). - timezone (string; optional): IANA timezone the wall-time start/end are interpreted in. - resource (string \ | number; optional): Id of the resource this event belongs to. - rrule (string \ | dict; optional): Recurrence rule — an RFC-5545 RRULE string ("FREQ=WEEKLY;INTERVAL=2;BYDAY=TH") or an object {freq, interval, byDay, byMonthDay, byMonth, count, until}. Recurrence is a Premium feature (use EventCalendarPremium). - exDates (list of strings; optional): Exception dates (ISO strings) excluded from the recurrence. - allDay (boolean; optional): Whether the event spans the whole day. - readOnly (boolean; optional): Whether the event cannot be edited / dragged / resized. - color (a value equal to: 'red', 'pink', 'purple', 'indigo', 'blue', 'teal', 'green', 'lime', 'amber', 'orange', 'grey'; optional): Event color (overrides resource + component color). - draggable (boolean; optional): Per-event drag override. - resizable (boolean \ | a value equal to: 'start', 'end'; optional): Per-event resize override (bool or which edge). - className (string; optional): Custom CSS class for the event element. - extractedFromId (string \ | number; optional): Id of the event this one was split from. |
height | number \ | string; default 600 | Height of the wrapping container (the calendar fills it). Default 600. | ||||
lastAction | dict; optional | Convenience OUTPUT describing the most recent change to events: {type: "create"\ | "update"\ | "delete"\ | "move"\ | "resize"\ | "change", event: the affected event (or None), event_timestamp}. lastAction is a dict with keys: - type (string; optional) - event (dict; optional) - event_timestamp (number; optional) |
localeText | dict; optional | Override UI label strings (a partial map of translation keys). | |||||
mobileBreakpoint | number; default 768 | Width (px) below which the UI switches to its mobile layout. Default 768. | |||||
preferences | dict; optional | Controlled user preferences. Also an OUTPUT. {ampm, weekStartsOn (0=Sun..6=Sat), showWeekends, showWeekNumber, isSidePanelOpen, showEmptyDaysInAgenda}. preferences is a dict with keys: - ampm (boolean; optional) - weekStartsOn (a value equal to: 0, 1, 2, 3, 4, 5, 6; optional) - showWeekends (boolean; optional) - showWeekNumber (boolean; optional) - isSidePanelOpen (boolean; optional) - showEmptyDaysInAgenda (boolean; optional) | |||||
preferencesMenuConfig | dict; optional | Which items appear in the preferences menu, or False to hide the menu. preferencesMenuConfig is a a value equal to: false \ | dict with keys: - toggleWeekendVisibility (boolean; optional) - toggleWeekNumberVisibility (boolean; optional) - toggleAmpm (boolean; optional) - toggleEmptyDaysInAgenda (boolean; optional) - toggleWeekStartsOn (boolean; optional) | ||||
readOnly | boolean; optional | Global read-only mode (disables create / drag / resize / dialog). | |||||
resources | list of dicts; optional | Resources events can be assigned to (supports nested children). | |||||
responsiveSidePanel | boolean; default True | When True (default), the side panel starts open on wide screens and collapsed below mobileBreakpoint on first render — unless you pin isSidePanelOpen via preferences / defaultPreferences. | |||||
scrollToCurrentTime | boolean; default False | In the day / week views, scroll the time grid on first render (and on view change) so the current-time indicator is centered in view. Pairs with showCurrentTimeIndicator. Default False. | |||||
shouldEventRequireResource | boolean; optional | Require every event to be assigned to a resource. Default False. | |||||
showCurrentTimeIndicator | boolean; optional | Show the current-time indicator line in time views. Default True. | |||||
sx | dict; optional | MUI sx styling object applied to the calendar (object form only). | |||||
view | a value equal to: 'day', 'week', 'month', 'agenda'; optional | Controlled active view. Also an OUTPUT (updated on view change). | |||||
views | list of a value equal to: 'day', 'week', 'month', 'agenda's; optional | Which views are offered. Default ["day","week","month","agenda"]. | |||||
visibleDate | string; optional | Controlled visible date (ISO string). Drives which date range is shown. Also an OUTPUT — written back (ISO string) when the user navigates. | |||||
visibleResources | dict; optional | Controlled resource visibility map {resourceId: bool}. Also an OUTPUT. |
Source: /localization
Note for AI agents: This is the static, prerendered view of an interactive Dash application served because we detected a non-JS user agent. Full prose docs:
- /localization/llms.txt — LLM-friendly documentation
- /sitemap.xml
- /robots.txt