Full Calendar plugin: Need Week-changed event

Hi,
I would like to catch week-changed event so i can refresh my calendar datasource.
Is there a way to add any javascript to catch that event when i click on previous/next buttons?

Thanks

1 Like

You don’t need custom JavaScript for this :slightly_smiling_face:

If you’re using a calendar plugin, most of them expose a state like “current date” or “visible month/week.” Instead of trying to catch the button click itself, you can trigger a workflow when that date state changes. That’s the clean Bubble way to handle it.

If your plugin doesn’t expose anything like that, then yes, you’d need JavaScript but only if the plugin gives you access to its internal events (like FullCalendar’s datesSet). In that case, you’d use the Toolbox plugin to run JS and send the new date back to Bubble.

But first check the element states. In most cases, you don’t need JS at all — you just react to the calendar’s date state changing.

Thank you for your explanation.
I don’t see any state like current date or visible month/week.
I will have to check.
Thank you

1 Like

You’re welcome :slightly_smiling_face:
Yes, definitely double check the element inspector first. Sometimes the state isn’t labeled “current week” directly it might be something like current date, displayed date, start date, or visible range.
If after checking you truly don’t see any exposed state changing when you click previous/next, then the plugin likely isn’t exposing that event to Bubble. In that case, the cleanest solution would be to hook into the calendar’s internal event (for example if it’s based on FullCalendar) and trigger a custom event back into Bubble using the Toolbox plugin. That way you can refresh your datasource reliably whenever the week changes.
If you let me know which calendar plugin you’re using, I can guide you more specifically :slightly_smiling_face:

That is FullCalendar Bubble plugin. I think I will have to catch JS event with Toolbox. (Next and previous Button évents)

That makes sense. Yes, with FullCalendar catching the JS event using Toolbox is probably the best move if the plugin isn’t exposing the date state. It sounds technical, but once you hook into the datesSet event and pass it back to Bubble, it should work smoothly. You’re actually thinking about this the right way.

That is quite strange this event is not exposed in the plugin

That makes sense. I checked the FullCalendar docs and datesSet is definitely a native event that fires whenever the view changes (next/prev, week switch, etc.), but a lot of the Bubble FullCalendar plugins don’t expose that callback. So if it’s not available in the element states, then hooking into datesSet with Toolbox and sending the new date range back into Bubble is the proper way to handle it. You’re not doing anything wrong, it’s just a plugin limitation.