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

Want to render calendar slots from 9am on the current day to 8am next day in the week #2707

Open
5 tasks done
kml-rohillaa opened this issue Jan 15, 2025 · 1 comment
Open
5 tasks done
Labels

Comments

@kml-rohillaa
Copy link

kml-rohillaa commented Jan 15, 2025

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/react-big-calendar-example-forked-w33qw4?file=%2Fsrc%2FApp.js%3A21%2C11

Bug description

I want to render a calendar from 9am current day to 8am next in the week view. All the other functionalities should be same.

Expected Behavior

Screenshot 2025-01-15 at 2 37 25 PM

Actual Behavior

RangeError
Invalid array length

react-big-calendar version

1.0.0

React version

18.2.0

Platform/Target and Browser Versions

All browsers

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
@7assenTlili
Copy link

@kml-rohillaa this doesn't appear to be a bug to me. My understanding is that minand max properties are agnostic to the specific day and simply constrain the time slots in the Day and Week views to fall within the [min, max] range. In your example, the issue arises because the max value (9am) is earlier than the min (8am) value, which leads to the error.

However, I believe this could make for a valuable feature request. It would be useful to introduce an additional mechanism—such as enabled/disabled time windows—to allow for the behavior you're looking.

I would be happy to work on a PR to implement this feature if the maintainers of the repository confirm that it is needed.

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