Open prestontunnellwilson opened 10 months ago
What localizer are you using? luxon
? Are you sure this is related to min
and max
? If this is possible for you, you could test changing localizers. I fixed this bug for moment
earlier this year (https://github.com/jquense/react-big-calendar/pull/2374), and it's not present in date-fns
, but as far as I know it's still present in luxon
.
What localizer are you using
This is using moment
, interestingly enough:
"moment": "2.29.4",
"moment-timezone": "0.5.38",
Could you try with date-fns
just to see if the problem persists?
@bu6n I am sorry for the delay in responding! Trying with date-fns
, the problem does not persist. I verified this in https://codesandbox.io/s/react-big-calendar-example-forked-g8hk7z?file=/index.js.
That seems to me to point to an issue somewhere in moment or the moment localizer. Does that match what you're thinking?
Yes, I only use date-fns
now because I had all sort of problems with moment...
Check that this is really a bug
Reproduction link
https://codesandbox.io/s/react-big-calendar-example-forked-w4u7s2?file=/index.js
Bug description
Viewing a week of events the week of the daylight savings time shift (in New York timezone) results in events being displayed on hour earlier. This happens when
min
andmax
are specified.They show the correct time in the Day view, but when November 5th, 2023 (when DST occurred), the events display one hour earlier:
You can see that the min and max are different in the day with DST compared to the days without. The code specifies
But when November 5th, 2023 shows up the min and max are instead 0700 and 2000.
Expected Behavior
The min's and max's are the same regardless of whether the week includes the Daylight Savings time transition or not, and the calendar events show up at the same time when they are scheduled for according to the Day view.
Actual Behavior
The min's and max's are shifted an hour earlier the week of DST when in week view and the day of DST when in day view and calendar events for that week in week view show up an hour earlier.
react-big-calendar version
1.8.5
React version
18.2.0
Platform/Target and Browser Versions
macOS Chrome
Validations
Would you like to open a PR for this bug?