DayPilot.Locale.register

The DayPilot.Locale.register() static method registers a locale so it can be referenced using its id.

Declaration

DayPilot.Locale.register(locale)

Parameters

Notes

Many common locales are registered by default. See the DayPilot.Locale class page for the built-in locale list.

Call this method after creating a custom DayPilot.Locale instance if you want to reference that locale using its id.

Example

const locale = new DayPilot.Locale("en-us", {
  dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
  dayNamesShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
  monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
  timePattern: "h:mm tt",
  datePattern: "M/d/yyyy",
  dateTimePattern: "M/d/yyyy h:mm tt",
  timeFormat: "Clock12Hours",
  weekStarts: 0
});

DayPilot.Locale.register(locale);

See Also

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript