Allow Customization or Removal of Event Date Range Limit
Description:
Hi there! First of all, thank you for creating such an amazing calendar library. I've been using it in my project, and it has been a great help so far.
However, I noticed that the EventsProvider seems to limit the range of events it processes to about 14 days in the past and 21 days in the future by default. After reviewing the code, I found that the notifyDataChanged function uses offset and pagesPerSide to calculate this range:
const minUnix = zonedDate.minus({ days: offset * pagesPerSide }).toMillis();
const maxUnix = zonedDate.plus({ days: offset * (pagesPerSide + 1) }).toMillis();
While this works for most cases, my use case requires processing events without such restrictions or with a larger range.
Questions:
-
Is there currently a way to customize or remove this range limit?
- For example, can we pass props or configuration to extend or completely disable this limit when consuming the library?
-
Are there plans to make this range configurable in future releases?
- It would be helpful if
offsetandpagesPerSidecould be set through props or context.
- It would be helpful if
Proposed Solution (Optional):
If there's no such option yet, I’d suggest the following improvements:
-
Allow consumers of the library to pass a
rangeLimitor similar prop toEventsProvideror the calendar component.- Example:
<CalendarKit rangeLimit={{ pastDays: 90, futureDays: 90, }} />
- Example:
-
Provide a way to completely disable the limit and fetch all events.
- Example: Setting
rangeLimittonullorInfinity.
- Example: Setting
Looking forward to hearing your thoughts on this. Please let me know if there’s any workaround in the meantime. Thanks again for your work on this awesome library! 🙌