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

Month View: events not rendering for the last day of the week. #2531

Open davidfaulks opened 7 months ago

davidfaulks commented 7 months ago

Check that this is really a bug

Reproduction link

n/a

Bug description

In monthly view, multi-day events are not rendering for the last day of the week. Unfortunately, my attempts to make a 'toy example' do not show the error. Changing localization does not affect the issue.

Screenshot 2024-03-10 at 9 12 45 AM

Expected Behavior

Multi-day events should render for the last day of the week.

Actual Behavior

No response

react-big-calendar version

1.11.1

React version

18.2.0

Platform/Target and Browser Versions

macOS Safari 17.31

Validations

Would you like to open a PR for this bug?

davidfaulks commented 7 months ago

I have now confirmed that this happens if the timezone is GMT or larger (eastern hemisphere). I am using the moment localizer, which I know is considered old fashioned nowadays. I will switch to a different date library and report the effects (later).

davidfaulks commented 7 months ago

Changing to the luxon localizer has no effect, the bug still occurs.

davidmh commented 7 months ago

~I think I ran into an instance of the same issue here: https://github.com/jquense/react-big-calendar/pull/2537#discussion_r1524166092~

~So maybe we should update getDateForSlot to turn the one-based slots into zero-based indexes~

That seems to be a separate issue.

davidmh commented 7 months ago

And while rendering the events, I've come up with a temporary solution by adding one second to the end of the range, just to push it over the edge.

Screenshot 2024-03-15 at 08 42 29
davidfaulks commented 6 months ago

After some more checking, I'll have amend this to 'any timezone with a greater offset than local time'