javascriptfullcalendarfullcalendar-6

FullCalendar locale not setting button labels and firstDay


According to docs, setting the locale property should translate header buttons and set the firstDay property, among others.

But this simple JS snipped (codepen) will be displayed with Sunday as first day of week.

Some strings are translated, like month name and weekdays.

document.addEventListener('DOMContentLoaded', function() {
  var calendarEl = document.getElementById('calendar');
  var calendar = new FullCalendar.Calendar(calendarEl, {
    initialView: 'timeGridWeek',
    locale: "it",
  });
  calendar.render();
});

Am I doing something wrong, or is it a bug? Is it maybe because I'm including the library from a cdn?


Solution

  • Found the answer myself by looking at the Locale Demo: the core JS is missing locale data, adding the URL below to the HTML made localization behave correctly.

    https://cdn.jsdelivr.net/npm/@fullcalendar/core@6.1.5/locales-all.global.min.js

    I'm rather new to FC and I found puzzling the missing of JS files into releases zip files.