streamlit-calendar icon indicating copy to clipboard operation
streamlit-calendar copied to clipboard

Implemented fullcalendar 'datesSet' callback

Open MaxvandenBoom opened this issue 1 year ago • 2 comments

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

MaxvandenBoom avatar Jan 08 '24 14:01 MaxvandenBoom