ProSchedulerSign in

Agenda · Localization

Localization

Weekday and month names, the week strip's first day and the empty-state text all follow the locale.

Live demo

Switch to French · Pick a day without events

Fullscreen
import { useState } from "react"
import { localeDe, localeEn, localeEs, localeFr, localePtBr, ProScheduler, type SchedulerLocale } from "@andreisaac/pro-scheduler"
import { studioEvents, studioResources } from "./data/studio"
import { Choice, Toolbar, useEvents } from "./kit"

const languages: [string, SchedulerLocale][] = [
  ["English", localeEn],
  ["Français", localeFr],
  ["Deutsch", localeDe],
  ["Español", localeEs],
  ["Português", localePtBr],
]

export function AgendaLocalizationDemo() {
  const { events, handlers } = useEvents(studioEvents)
  const [language, setLanguage] = useState(2)

  return (
    <div className="docs-demo__stack">
      <Toolbar label="Language">
        {languages.map(([name], i) => (
          <Choice key={name} active={language === i} onClick={() => setLanguage(i)}>
            {name}
          </Choice>
        ))}
      </Toolbar>
      <ProScheduler
        data={events}
        resources={studioResources}
        locale={languages[language][1]}
        view={{ calendar: { type: "week" }, agenda: { type: "day" } }}
        height={520}
        {...handlers}
      />
    </div>
  )
}

About this demo

Weekday and month names, the week strip's first day and the empty-state text all follow the locale.

Things to try

  • Switch to French
  • Pick a day without events

The props behind it are explained in Localization.

Use ProScheduler in your project