You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configure a localizer with a timezone to the east of the browser's current timezone.
Create an event that spans multiple weeks
Display a month view. Note that the event segments are not spanning correctly.
I believe this may be the same issue as #2425 , however it appears to happen consistently in any timezone, and consistently with either the moment or luxon localizers. feel free consolidate if this is a duplicate.
Expected Behavior
Segments include the last day of the event.
Segments extend to the last day of the week when multi-week
Actual Behavior
Segments ends the day before the end of the event.
Segments omit last day of the week when multi-week. (For example, ending on friday if the last day of the week is saturday).
The issue appears to be with the getBrowserTzOffset in the localizers, ie here for luxon. This configures the segmentOffsethere and is used to explictly subtract the width of the segment here:
// The segmentOffset is necessary when adjusting for timezones
// ahead of the browser timezone
span=Math.max(span-localizer.segmentOffset,1)
It seems like this is subtracting "1" in situations where the segments are already correct. I've found that simply removing the segmentOffset appears to resolve the issue in my test case. I'm not sure exactly when it is necessary to subtract 1 (if ever?), but it seems to happening more often than it should.
Check that this is really a bug
Reproduction link
https://codesandbox.io/p/sandbox/react-big-calendar-example-forked-wc6sts
Bug description
I believe this may be the same issue as #2425 , however it appears to happen consistently in any timezone, and consistently with either the moment or luxon localizers. feel free consolidate if this is a duplicate.
Expected Behavior
Actual Behavior
react-big-calendar version
1.14.1
React version
18.2.0
Platform/Target and Browser Versions
macOS 14.4, Chrome 129
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: