DayPilot.Locale Constructor

The DayPilot.Locale constructor creates a locale object that defines localized day names, month names, and date/time formatting rules.

Declaration

new DayPilot.Locale(id, properties)

Parameters

  • id (string) - locale identifier, for example "en-us".

  • properties (object) - locale settings that specify day names, month names, and formatting fields such as timePattern, datePattern, dateTimePattern, and timeFormat.

Notes

The properties object shown below defines custom day and month names together with 12-hour time formatting.

Example

const localeUS = 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", ""],
  timePattern: "h:mm tt",
  datePattern: "M/d/yyyy",
  dateTimePattern: "M/d/yyyy h:mm tt",
  timeFormat: "Clock12Hours"
});

See Also

DayPilot.Locale Class

Calendar Localization [doc.daypilot.org]

Scheduler Localization [doc.daypilot.org]

Navigator Localization [doc.daypilot.org]

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript