Skip to main content

setLocale()

Description

Applies a new locale to Event Calendar

Usage

setLocale(null | locale?: object): void;

Parameters

  • null - (optional) resets to the default locale (English)
  • locale - (optional) the object of data of the new locale to be applied
info

Using this method, you can apply a new locale to Event Calendar. To reset widget to the default locale, call the method without arguments (or with a null value)

Example

// create Event Calendar
const calendar = new eventCalendar.EventCalendar("#root", {
locale: eventcalendar.en // the "en" locale is set by default
});
// apply "de" locale
calendar.setLocale(eventCalendar.de);

Related articles: Localization