streamlit-calendar
streamlit-calendar copied to clipboard
Implemented fullcalendar 'datesSet' callback
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
and eventsSet
are triggered. I think setComponent causes only eventsSet
to be triggered. As a result, the datesSet
callback only works when there is no eventsSet
callback requested. I added a warning in the component creation, but maybe you can think of a more elegant solution...
Best, Max