Implemented fullcalendar 'datesSet' callback #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Muhammad,
I noticed that the fullcalendar Streamlit component did not have a callback for date changes in the fullcalender yet. This is handy, for example, when the prev/next buttons are used in the calendar. As such, I implemented the fullcalendar's
datesSet
callback (https://fullcalendar.io/docs/datesSet) and wanted to share it.For this update, I build upon your most recent release (22 dec 2023) and followed your style of coding (return format and variable naming).
One problem though: when the calendar’s dates change, both
datesSet
andeventsSet
are triggered. I think setComponent causes onlyeventsSet
to be triggered. As a result, thedatesSet
callback only works when there is noeventsSet
callback requested. I added a warning in the component creation, but maybe you can think of a more elegant solution...Best,
Max