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

Default Calendar Sources for renderCalendar + Cache Bugfix (Breaking Option) #456

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jarekbird
Copy link

@jarekbird jarekbird commented May 23, 2023

In trying to simply render the default calendar based on the global settings, I found it to be a bit difficult to do.

This PR simplifies the process by having the renderCalendar function default the events to all events from the event sources set in the global settings. I've also added this case as one of the basic examples in the documentation


Additionally, I was able to tackle the bug mentioned in the advanced docs, but my solution was a breaking change because the public API is modified. See comment below for details.


I was able to find a solution that is not a full breaking change. I think this PR might be slightly cleaner, but it is a breaking change. See this alternative PR for the non breaking change option: #456

@jarekbird jarekbird changed the title Jarekbird/support inline default calendar Jarekbird/Default Calendar Sources for renderCalendar May 23, 2023
@@ -11,8 +11,6 @@ renderCalendar(this.container, [[{start: new Date(), id: "id", title: "Now and f
```
````

Unfortunately, there's a bug on first render and you need to interact with the calendar by changing the week or view before it renders properly.
Copy link
Author

@jarekbird jarekbird May 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the cache had not been initialized, then the bug mentioned above would occur. This PR fixes this problem by conditionally initializing the cache as part of the renderCalendar() function.

This solution required setting the renderCalendar() function to be an async function because the cache initialization is async, which changes the public API. :/ Docs are updated to reflect this. This is a breaking change.

@jarekbird jarekbird changed the title Jarekbird/Default Calendar Sources for renderCalendar Default Calendar Sources for renderCalendar + Cache Bugfix (Breaking Option) May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant