Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DayjsLocalizer slows calendar when set default timezone #2448

Open
4 of 5 tasks
sinedie opened this issue Sep 24, 2023 · 3 comments
Open
4 of 5 tasks

DayjsLocalizer slows calendar when set default timezone #2448

sinedie opened this issue Sep 24, 2023 · 3 comments
Labels

Comments

@sinedie
Copy link

sinedie commented Sep 24, 2023

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/s/react-big-calendar-example-forked-gyv3sn?file=/src/App.js

Bug description

When using DayjsLocalizer with a default timezone the calendar gets really laggy. Seems like it re-renders or render too slow.

Expected Behavior

No response

Actual Behavior

No response

react-big-calendar version

^1.8.4

React version

18.2.0

Platform/Target and Browser Versions

NodeJs v18.14.2, Firefox 117.0.1

Validations

  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a react-big-calendar issue and not an implementation issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
@sinedie sinedie added the bug label Sep 24, 2023
@georgichichev
Copy link

georgichichev commented Nov 30, 2023

@sinedie Have you found some kind of a fix for this? I am experiencing the same issue.

@sinedie
Copy link
Author

sinedie commented Nov 30, 2023

@georgichichev I just don't configure any timezone at the moment. It is not ideal -but in my use case my users are in the same country-.

But still, you could use momentjs or date-fns as DateLocalizer. The downside is if you still wanna use Dayjs in your dates -outside the calendar- then you have two packages for the same thing.

@georgichichev
Copy link

@sinedie I strictly have to configure a timezone because some events are then displayed with 1 extra day if I do not configure a timezone. The events that are displayed on the calendar are created by the users. For example, an event that has this end date "2023-11-08T23:59:59.000Z" will end on 2023-11-09 on the calendar. Have not found any other way to fix this.

I don't know if it is a good idea to use momentjs for the localizer since all the rest of the application - forms, datepickers etc. are using dayjs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants