search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How to change language of calendar in modal form?

Asked by Bernardo
5 hours ago.

Hi, I'm using a daypilot modal form with type date https://modal.daypilot.org/form-date-field/. When I click this field it's always in english even if I've set the DayPilot scheduler locale to a different language. How do I change the language the calendar of the date field is in?

Answer posted by Dan Letecky [DayPilot]
2 hours ago.

You can specify the locale option for the modal form:

const showDialog = async () => {

  const form = [
    { name: "Name", id: "name" },
    // ...
  ];

  const data = {};

  const options = {
    locale: "de-de"
  };

  const modal = await DayPilot.Modal.form(form, data, options);

  // ...
};

You can also specify the locale directly for the selected fields:

const showDialog = async () => {

  const form = [
    { name: "Name", id: "name" },
    { name: "Start", id: "start", type: "datetime", locale: "de-de" },
    // ...
  ];

  const data = {};

  const modal = await DayPilot.Modal.form(form, data);

  // ...
};
New Reply
This reply is
Attachments:
or drop files here
Your name (optional):