fullcalendarfullcalendar-5fullcalendar-3

Fullcalendar v3 weekNumbers bug


I use Fullcalendar v 3.10.0 and I have a little bug with weekNumbers

Wrong numeration of weeks

For example v3.10.5 bug

  $(function() {

  $('#calendar').fullCalendar({
    defaultView: 'month',
     weekNumbers: true,
     firstDay: 1,
      defaultDate: "2022-01-01",
    events: 'https://fullcalendar.io/api/demo-feeds/events.json'
  });

});

https://codepen.io/serhii-danovsky/pen/GRxPjOw enter image description here

And v 5.11.2 no bug

document.addEventListener('DOMContentLoaded', function() {
  var calendarEl = document.getElementById('calendar');

  var calendar = new FullCalendar.Calendar(calendarEl, {
    defaultView: 'month',
    weekNumbers: true,
    firstDay: 1,
    initialDate: '2022-01-01',
    events: 'https://fullcalendar.io/api/demo-feeds/events.json'
  });

  calendar.render();
});

https://codepen.io/serhii-danovsky/pen/qBoLaPP

enter image description here

How can I fix this Without version update


Solution

  • You can try adding the option

    weekNumberCalculation: 'ISO'
    

    which seems to correct the numbering to how you wish

    Demo in CodePen - FullCalendar v3