jquense / react-big-calendar

gcal/outlook like calendar component
http://jquense.github.io/react-big-calendar/examples/index.html
MIT License
7.81k stars 2.23k forks source link

Incorrect Calendar display and missing dates in 'month' view when using dayjsLocalizer - March 2024 #2534

Open ncaraker opened 7 months ago

ncaraker commented 7 months ago

Check that this is really a bug

Reproduction link

https://jquense.github.io/react-big-calendar/examples/index.html?path=/docs/examples--dayjs-localizer

Bug description

When using the dayjsLocalizer the month view for March 2024 is incorrect. March 10th 2024 is missing entirely and the days of the week display do not align with the dates on the calendar. This can be seen in the storybook examples provided (here) Note: To reproduce this you must view March 2024 on this story

Expected Behavior

All dates should show on the calendar. The days of the week should start on Sunday and should align with calendar dates as expected

Screenshot 2024-03-12 at 4 39 13 PM

Actual Behavior

March 10th 2024 is missing entirely from the calendar, and the days of the week start on incorrect day and do not line up with the corresponding days on the calendar.

Screenshot 2024-03-12 at 4 41 56 PM

react-big-calendar version

1.11.2

React version

^17.0.2

Platform/Target and Browser Versions

All platforms

Validations

Would you like to open a PR for this bug?

sethmcleod commented 6 months ago

We're also seeing issues with the dayjs localizer. Not the same as you (March 10 isn't missing) but many of the days in March are incorrectly rendering as out of range. This happens for all the years we've tested and is reproducible in the Storybook. Switching to Moment localizer resolves the issue.

image
prescarlton commented 5 months ago

i can take a look at trying to tackle this.

prescarlton commented 5 months ago

Looks like it's directly related to leap years.

martin-luo commented 2 months ago

This issue still exists in version 1.13.1.

Here is how it looks when I use dayjs as the localizer: image

And here is how it looks when I use luxon: image

As we can see, the cells for 01 - 05 is not rendered correctly