setOption startParam works weird in fullcalendar v5

I was trying to set startParam option dynamically.

But it seems working weird by updating the key rather update value.

calendarEvents.setOption('startParam', moment().format());
calendarEvents.refetchEvents();

If I run the methods and check the form data, then the startParam will be look like the following.

2021-02-15T19:09:13-07:00: 2021-01-01T00:00:00-07:00
end: 2030-01-01T00:00:00-07:00

I guess the setOption method updates the key not value for the start params.

Why does this happen and how to fix this?

38 thoughts on “setOption startParam works weird in fullcalendar v5”

  1. It’s working properly.

    The startParam option sets the name of the parameter which fullCalendar sends to the server for the start value, when fetching events. It doesn’t set the value. The value which is sent is always the start date of the range which the user has just navigated to. You don’t need to change that value yourself, and anyway it makes no sense to try and give it a fixed value – it is adjusted dynamically by fullCalendar every time events need fetching.

    What are you actually trying to achieve with this code? Are you trying to change the current date on the calendar programmatically? If so then use https://fullcalendar.io/docs/Calendar-gotoDate

    Reply

Leave a Comment