Calendar display bug

I think I have an issue with the calendar display

In October, I have the 25th twice, a Sunday and a Monday.

In the weekly view, the day goes from 10 p.m. to 9 p.m.

Same in the daily view

Have other people noticed these issues?

Hello,

I actually have the same bugs and it’s not just in October :sweat_smile:


bug on Mars 2027 where the grayed-out days at the end of the month are incorrect.

So I’m going to open a PR to fix all these points

I dug into this bug, and there are actually three distinct symptoms sharing a single cause.

The cause

The front end uses dayjs for all date calculations. A dashboard box (EDF Tempo) loaded the timezone plugin of dayjs to read the time in Paris.

The problem: dayjs.extend() globally modifies dayjs for the entire application. And the calendar library (react-big-calendar) contains this test:

// if the timezone plugin is loaded, then use the timezone aware version
const dayjs = dayjsLib.tz ? dayjsLib.tz : dayjsLib;

As soon as the plugin is present, the calendar switches all its calculations to dayjs.tz, which behaves differently:

  • it interprets certain dates as UTC β†’ the time grid shifts by 2 hours
  • add(1, β€Ή jour β€Ί) adds 24 absolute hours, whereas the day of the winter time change lasts 25 hours β†’ we fall back to 23:00 on the same day, hence the date displayed twice
  • startOf(β€Ή mois β€Ί) shifts by one hour, which distorts the comparison of months β†’ the greying inverts

Important point: this box was statically imported with all the others, so the plugin was loaded even if you never used EDF Tempo.

The fix

Instead of patching the calendar, I removed the cause: the EDF Tempo box now uses Intl.DateTimeFormat (native, without side effects) to read the time in Paris. The business behavior is identical β€” the full/off-peak hours remain defined in French time regardless of your time zone.

There remains a fix in the calendar, for a bug independent of this one: the day of the time change displayed 26 time slots in October and 22 in March instead of 24, and the events were mispositioned (an appointment at 14:00 was displayed at 13:26).

The PR: